Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. IdentityCredential
  4. disconnect()

IdentityCredential: disconnect() static method

Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.

Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.

Thedisconnect() static method of theIdentityCredential interface disconnects a specified federated sign-in account from theIdP used to obtain the credential.

Afterwards, using that account for federated login requires starting the federated sign-in process again.

Syntax

js
IdentityCredential.disconnect(options)

Parameters

options

An options object, which can contain the following properties:

accountHint

A 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 thedisconnect endpoint can identify the account — for example an email address or user ID. This will not necessarily match the account ID provided by theaccounts list endpoint.

clientId

A string specifying theRP's client identifier, as specified in theprovidersclientId property during sign-in.

configURL

A string specifying the config file URL of the IdP, as specified in theprovidersconfigURL property during sign-in.

Return value

APromise that fulfills withundefined.

Exceptions

InvalidStateErrorDOMException

Thrown if:

  • The IdP'sconfigURL is invalid or missing thedisconnect_endpoint.
  • The document's origin does not match theconfigURL.
NetworkErrorDOMException

Thrown if:

  • The browser is unable to connect to the IdP.
  • The request is disallowed by aconnect-srcContent-Security-Policy.
  • Anotherdisconnect() call was previously made that has not yet resolved.
  • The FedCM API has been disabled globally.
  • The IdP'sconfigURL is neither secure norpotentially trustworthy.
NotAllowedErrorDOMException

Thrown if the embedding<iframe> does not have anidentity-credentials-getPermissions-Policy set to allow the use ofdisconnect() or if the FedCM API is disabled globally by a policy set on the top-level document.

Examples

Basicdisconnect() usage

The RP may disconnect a specified federated sign-in account from the associated IdP by invokingdisconnect(). This function can be called from a top-level RP frame.

js
IdentityCredential.disconnect({  configURL: "https://idp.example.com/config.json",  clientId: "rp123",  accountHint: "account456",});

For adisconnect() call to work, the IdP must include adisconnect_endpoint in its config file. SeeThe disconnect endpoint for more details of the underlying HTTP communication.

Specifications

Specification
Federated Credential Management API
# dom-identitycredential-disconnect

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp