IdentityCredential Class

A credential of Federated Credential Management (https://w3c-fedid.github.io/FedCM/#browser-api-identity-credential-interface): the token that an identity provider minted for the site, returned by navigator.credentials.get({ identity }) once the user chose an account (see UserAgentUIBackend.ChooseIdentityAccountAsync).

public sealed class IdentityCredential : Credential
Inheritance
Credential IdentityCredential

Properties

NameDescription
ConfigUrlGets the URL of the config file of the identity provider that issued the credential.
IdGets the identifier of the credential: the empty string.
IsAutoSelectedGets whether the account was selected without asking the user (the auto reauthentication of a returning account).
TokenGets the token minted by the identity provider: the value of the token member of the response of its identity assertion endpoint, or the token given to IdentityProvider.resolve() (a value of the script, or a JSON node without script engine).
TypeGets the type of the credential: identity.

Gets the URL of the config file of the identity provider that issued the credential.

public string ConfigUrl { get; }

Gets the identifier of the credential: the empty string.

public override string Id { get; }

Property value

string

IsAutoSelected

IdentityCredential.cs

Gets whether the account was selected without asking the user (the auto reauthentication of a returning account).

public bool IsAutoSelected { get; }

Gets the token minted by the identity provider: the value of the token member of the response of its identity assertion endpoint, or the token given to IdentityProvider.resolve() (a value of the script, or a JSON node without script engine).

public object? Token { get; }

Gets the type of the credential: identity.

public override string Type { get; }

Property value

string

Methods

NameDescription
Disconnect(IdentityCredentialDisconnectOptions)Disconnects an account of an identity provider from the site (https://w3c-fedid.github.io/FedCM/#dom-identitycredential-disconnect): the disconnect endpoint of the provider is called, and the account is removed from the connected accounts. 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, and a NetworkError when no account of the provider is connected to the site, a disconnection is pending, or the provider fails.

Disconnect(IdentityCredentialDisconnectOptions)

IdentityCredential.cs

Disconnects an account of an identity provider from the site (https://w3c-fedid.github.io/FedCM/#dom-identitycredential-disconnect): the disconnect endpoint of the provider is called, and the account is removed from the connected accounts. 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, and a NetworkError when no account of the provider is connected to the site, a disconnection is pending, or the provider fails.

public static Task Disconnect(IdentityCredentialDisconnectOptions options)

Parameters

options IdentityCredentialDisconnectOptions
The identity provider and the hint of the account.

Returns

Task

See also