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.
Inherits properties from its ancestor, Credential.
IdentityCredential.configURL Read only Experimental
A string specifying the config file URL of the IdP used for sign-in.
IdentityCredential.isAutoSelected Read only Experimental
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 Experimental
Returns the token used to validate the associated sign-in.
IdentityCredential.disconnect() Experimental
Disconnects the federated sign-in account used to obtain the credential.
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:
async function signIn() {
const identityCredential = await navigator.credentials.get({
identity: {
providers: [
{
configURL: "https://accounts.idp.example/config.json",
clientId: "********",
nonce: "******",
},
],
},
});
}
If successful, this call will fulfill with an IdentityCredential instance. From this, you could return the IdentityCredential.token value, for example:
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.
| 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 |
108 | 108 | No | 94 | No | 108 | No | 73 | No | 21.0 | No | No |
configURL |
136 | 136 | No | 121 | No | 136 | No | 90 | No | No | No | No |
disconnect_static |
122 | 122 | No | 108 | No | 122 | No | 81 | No | 26.0 | No | No |
isAutoSelected |
120 | 120 | No | 106 | No | 120 | No | 80 | No | 25.0 | No | No |
token |
108 | 108 | No | 94 | No | 108 | No | 73 | No | 21.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