IdentityCredential

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

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 IdentityCredential interface of the Federated Credential Management API (FedCM) represents a user identity credential arising from a successful federated sign-in.

A successful navigator.credentials.get() call that includes an identity option fulfills with an IdentityCredential instance.

Credential IdentityCredential

Instance properties

Inherits properties from its ancestor, Credential.

IdentityCredential.configURL Read only

A string specifying the config file URL of the IdP used for sign-in.

IdentityCredential.isAutoSelected Read only

A boolean value that indicates whether the federated sign-in was carried out using auto-reauthentication (i.e., without user mediation) or not.

IdentityCredential.token

Returns the token used to validate the associated sign-in.

Static methods

IdentityCredential.disconnect()

Disconnects the federated sign-in account used to obtain the credential.

Examples

Basic federated sign-in

Relying parties (RPs) can call navigator.credentials.get() with the identity option to make a request for users to sign in to the RP via an identity provider (IdP), using identity federation. A typical request would look like this:

js
async function signIn() {
  const identityCredential = await navigator.credentials.get({
    identity: {
      providers: [
        {
          configURL: "https://accounts.idp.example/config.json",
          clientId: "********",
          params: {
            /* IdP-specific parameters */
          },
        },
      ],
    },
  });
}

If successful, this call will fulfill with an IdentityCredential instance. From this, you could return the IdentityCredential.token value, for example:

js
console.log(identityCredential.token);

Check out Federated Credential Management API (FedCM) for more details on how this works. This call will start off the sign-in flow described in FedCM sign-in flow.

Specifications

Specification
Federated Credential Management API
# browser-api-identity-credential-interface

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
IdentityCredential
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
configURL
Experimental
Chrome – Full support
Chrome 136 (Release date: 2025-04-29)
footnote Full support
Edge – Full support
Edge 136 (Release date: 2025-05-01)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 121 (Release date: 2025-08-27)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 136 (Release date: 2025-04-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 90 (Release date: 2025-06-18)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 29 (Release date: 2025-10-25)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
disconnect() static method
Experimental
Chrome – Full support
Chrome 122 (Release date: 2024-02-20)
footnote Full support
Edge – Full support
Edge 122 (Release date: 2024-02-23)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 108 (Release date: 2024-03-05)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 122 (Release date: 2024-02-20)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 81 (Release date: 2024-03-14)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 26 (Release date: 2024-06-07)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
isAutoSelected
Experimental
Chrome – Full support
Chrome 120 (Release date: 2023-12-05)
footnote Full support
Edge – Full support
Edge 120 (Release date: 2023-12-07)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 106 (Release date: 2023-12-19)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 120 (Release date: 2023-12-05)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 80 (Release date: 2024-01-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 25 (Release date: 2024-04-24)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
token
Experimental
Chrome – Full support
Chrome 108 (Release date: 2022-11-29)
footnote Full support
Edge – Full support
Edge 108 (Release date: 2022-12-05)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 94 (Release date: 2022-12-15)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 108 (Release date: 2022-11-29)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 73 (Release date: 2023-01-17)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 21 (Release date: 2023-05-19)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.

See also