Table of Contents

Class IdentityCredential

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The IdentityCredential 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.

-Federated Credential Management API

See also on MDN

Constructors

IdentityCredential()

public IdentityCredential()

Properties

IsAutoSelected

NOTE
Experimental
The isAutoSelected 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. true indicates that automatic reauthentication was used; false indicates 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.

-Federated Credential Management API

See also on MDN

Token

NOTE
Experimental
The token 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.

-Federated Credential Management API

See also on MDN

Methods

Disconnect(IdentityCredentialDisconnectOptions)

NOTE
Experimental
The disconnect() 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

options IdentityCredentialDisconnectOptions

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)

See also on MDN