SecurityTokenDescriptor.AddAuthenticationClaims Method

Definition

Adds the specified authentication claims to the subject of the current instance.

Overloads

AddAuthenticationClaims(String)

Adds a claim for the specified authentication method to the subject of the current instance. The authentication instant is set to the current time.

AddAuthenticationClaims(String, DateTime)

Adds claims for the specified authentication type and authentication instant to the subject of the current instance.

AddAuthenticationClaims(String)

Adds a claim for the specified authentication method to the subject of the current instance. The authentication instant is set to the current time.

C#
public void AddAuthenticationClaims(string authType);

Parameters

authType
String

A URI that specifies the authentication method.

Remarks

A Claim with a claim type of AuthenticationMethod and a value of authType and a Claim with a claim type of AuthenticationInstant and a value of UtcNow are added to the ClaimsIdentity specified by the Subject property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

AddAuthenticationClaims(String, DateTime)

Adds claims for the specified authentication type and authentication instant to the subject of the current instance.

C#
public void AddAuthenticationClaims(string authType, DateTime time);

Parameters

authType
String

A URI that specifies the authentication method.

time
DateTime

The authentication instant in UTC. If the time is not in UTC, it is converted to UTC.

Remarks

A Claim with a claim type of AuthenticationMethod and a value of authType and a Claim with a claim type of AuthenticationInstant and a value of time are added to the ClaimsIdentity specified by the Subject property.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1