IdentityProvider Class

The API of the pages of an identity provider (https://w3c-fedid.github.io/FedCM/#browser-api-identity-provider-interface): the login page and the continuation page that the user agent opens in a popup window during a FedCM request tell when they are done (IdentityProvider.Close, IdentityProvider.Resolve), and an iframe of the provider can read the accounts connected to its embedder (IdentityProvider.GetUserInfo).

public sealed class IdentityProvider

Methods

NameDescription
Close()Tells that the login flow of the identity provider is done (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-close): the login page (or the continuation page) opened by a FedCM request is closed. It does nothing in another window.
GetUserInfo(IdentityProviderConfig)Returns the accounts of the identity provider that are connected to the embedder of the iframe of the provider that calls it (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-getuserinfo). The task fails with a NotAllowedError DomException when the document is not allowed to use the identity-credentials-get feature, an InvalidStateError when the config URL is not valid or is not same origin with the document, and a NetworkError when no account is connected, the document is not in an iframe, or the provider fails.
Resolve(object?, IdentityResolveOptions?)Returns a token to the site from the continuation page opened by a FedCM request (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-resolve): the page is closed and the request resolves with an IdentityCredential whose token is token. The task fails with a NotAllowedError DomException in another window.

Tells that the login flow of the identity provider is done (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-close): the login page (or the continuation page) opened by a FedCM request is closed. It does nothing in another window.

public static void Close()

GetUserInfo(IdentityProviderConfig)

IdentityCredential.cs

Returns the accounts of the identity provider that are connected to the embedder of the iframe of the provider that calls it (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-getuserinfo). The task fails with a NotAllowedError DomException when the document is not allowed to use the identity-credentials-get feature, an InvalidStateError when the config URL is not valid or is not same origin with the document, and a NetworkError when no account is connected, the document is not in an iframe, or the provider fails.

public static Task<IReadOnlyList<IdentityUserInfo>> GetUserInfo(IdentityProviderConfig config)

Resolve(object?, IdentityResolveOptions?)

IdentityCredential.cs

Returns a token to the site from the continuation page opened by a FedCM request (https://w3c-fedid.github.io/FedCM/#dom-identityprovider-resolve): the page is closed and the request resolves with an IdentityCredential whose token is token. The task fails with a NotAllowedError DomException in another window.

public static Task Resolve(object? token, IdentityResolveOptions? options = null)

Parameters

token object?
The token (a value of the script, serialized with JSON.stringify()).
options IdentityResolveOptions?
The account that the token is for, when it is not the account chosen by the user.

Returns

Task

See also