The IdentityProvider
interface of the Federated Credential Management (FedCM) API represents an identity provider (IdP) and provides access to related information.
Static methods
getUserInfo()
Experimental
-
Returns information about a previously signed in user on their return to an IdP, which can be used to provide a personalized welcome message and sign-in button.
Examples
const user_info = await IdentityProvider.getUserInfo({
configUrl: "https://idp.example/fedcm.json",
clientId: "client1234",
});
if (user_info.length > 0) {
const name = user_info[0].name;
const given_name = user_info[0].given_name;
const display_name = given_name ? given_name : name;
const picture = user_info[0].picture;
const email = user_info[0].email;
}
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
IdentityProvider |
116 |
116 |
No |
No |
102 |
No |
116 |
116 |
No |
No |
No |
No |
getUserInfo_static |
116 |
116 |
No |
No |
102 |
No |
116 |
116 |
No |
No |
No |
No |
See also