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 IdentityProviderMethods
| Name | Description |
|---|---|
| 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. |
Close()
IdentityCredential.csTells 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.csReturns 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)Parameters
configIdentityProviderConfig- The identity provider.
Returns
Task<IReadOnlyList<IdentityUserInfo>>
See also
Resolve(object?, IdentityResolveOptions?)
IdentityCredential.csReturns 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
tokenobject?- The token (a value of the script, serialized with
JSON.stringify()). optionsIdentityResolveOptions?- The account that the token is for, when it is not the account chosen by the user.