Class IdentityCredential
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
NOTE
ExperimentalIdentityCredential interface of the Federated Credential Management API (FedCM) represents a user identity credential arising from a successful federated sign-in.
[Value("IdentityCredential")]
public class IdentityCredential : Credential
- Inheritance
-
IdentityCredential
- Inherited Members
Remarks
A successful Get(CredentialRequestOptions) call that includes an identity option fulfills with an IdentityCredential instance.
Constructors
IdentityCredential()
public IdentityCredential()
Properties
IsAutoSelected
NOTE
ExperimentalisAutoSelected read-only property of the IdentityCredential interface indicates whether the federated sign-in flow was carried out using auto-reauthentication (i.e., without user mediation) or not.
[Value("isAutoSelected")]
public bool IsAutoSelected { get; }
Property Value
- bool
A boolean value.
trueindicates that automatic reauthentication was used;falseindicates that it was not.
Remarks
Automatic reauthentication can occur when a Get(CredentialRequestOptions) call is issued with a mediation option value of "optional" or "silent". It is useful for a Relying party (RP) to know whether auto reauthentication occurred for analytics/performance evaluation and for UX purposes — automatic sign-in may warrant a different UI flow to non-automatic sign-in.
Token
NOTE
Experimentaltoken read-only property of the IdentityCredential interface returns the token used to validate the associated sign-in.
[Value("token")]
public string? Token { get; }
Property Value
- string
Any type.
Remarks
The FedCM API does not define the structure of the token object or what the RP should do with it: this depends entirely on the federated identity protocol that the IdP implements.
When an RP chooses to work with a particular IdP, they will provide instructions for how to interpret and use the returned token value.
Methods
Disconnect(IdentityCredentialDisconnectOptions)
NOTE
Experimentaldisconnect() static method of the IdentityCredential interface disconnects a specified federated sign-in account from the {{glossary("Identity provider", "IdP")}} used to obtain the credential.
[Value("disconnect")]
public static Task<GlobalObject.Undefined> Disconnect(IdentityCredentialDisconnectOptions options = null)
Parameters
Returns
- Task<GlobalObject.Undefined>
A Promise that fulfills with GlobalObject.Undefined.
Remarks
Afterwards, using that account for federated login requires starting the federated sign-in process again.
-Federated Credential Management API on developer.chrome.com (2023)