Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The disconnect() static method of the IdentityCredential interface disconnects a specified federated sign-in account from the IdP used to obtain the credential.
Afterwards, using that account for federated login requires starting the federated sign-in process again.
IdentityCredential.disconnect(options)
optionsAn options object, which can contain the following properties:
accountHintA string specifying an account hint that the IdP uses to identify the account to disconnect. The hint can be an arbitrary string as long as the disconnect endpoint can identify the account — for example an email address or user ID. This will not necessarily match the account ID provided by the accounts list endpoint.
clientIdA string specifying the RP's client identifier, as specified in the providers clientId property during sign-in.
configURLA string specifying the config file URL of the IdP, as specified in the providers configURL property during sign-in.
A Promise that fulfills with undefined.
InvalidStateError DOMException
Thrown if:
configURL is invalid or missing the disconnect_endpoint.configURL.NetworkError DOMException
Thrown if:
connect-src Content-Security-Policy.disconnect() call was previously made that has not yet resolved.configURL is neither secure nor potentially trustworthy.NotAllowedError DOMException
Thrown if the embedding <iframe> does not have a identity-credentials-get Permissions-Policy set to allow the use of disconnect() or if the FedCM API is disabled globally by a policy set on the top-level document.
disconnect() usageThe RP may disconnect a specified federated sign-in account from the associated IdP by invoking disconnect(). This function can be called from a top-level RP frame.
IdentityCredential.disconnect({
configURL: "https://idp.example.com/config.json",
clientId: "rp123",
accountHint: "account456",
});
For a disconnect() call to work, the IdP must include a disconnect_endpoint in its config file. See The disconnect endpoint for more details of the underlying HTTP communication.
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
disconnect_static |
122 | 122 | No | 108 | No | 122 | No | 81 | No | 26.0 | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/IdentityCredential/disconnect_static