files/en-us/web/api/identitycredential/disconnect_static/index.md
{{APIRef("FedCM API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The disconnect() static method of the {{domxref("IdentityCredential")}} interface disconnects a specified federated sign-in account from the {{glossary("Identity provider", "IdP")}} used to obtain the credential.
Afterwards, using that account for federated login requires starting the federated sign-in process again.
IdentityCredential.disconnect(options)
options
accountHint
clientId
providers clientId property during sign-in.configURL
providers configURL property during sign-in.A {{jsxref("Promise")}} that fulfills with {{jsxref("undefined")}}.
InvalidStateError {{domxref("DOMException")}}
configURL is invalid or missing the disconnect_endpoint.configURL.NetworkError {{domxref("DOMException")}}
connect-src {{httpheader("Content-Security-Policy")}}.disconnect() call was previously made that has not yet resolved.configURL is neither secure nor potentially trustworthy.NotAllowedError {{domxref("DOMException")}}
<iframe> does not have an {{httpheader("Permissions-Policy/identity-credentials-get", "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.
{{Specifications}}
{{Compat}}