ClaimsIdentity.Claims Property

Definition

Gets the claims associated with this claims identity.

C#
public virtual System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> Claims { get; }

Property Value

The collection of claims associated with this claims identity.

Remarks

The collection may contain entries that are null.

The claims contained in the Claims collection essentially describe the entity that is represented by the ClaimsIdentity. The claims describe the properties and rights possessed by the entity and can be examined by applications to make decisions about authentication and authorization.

Märkus

The ClaimsPrincipal class has a Claims property as well. In the majority of cases you should access the user's claims through the ClaimsPrincipal.Claims collection rather than through the Claims collection. You will need to access the claims of an individual ClaimsIdentity only in the cases where the principal contains more than one ClaimsIdentity and you need to evaluate or modify a specific identity.

Applies to

Toode Versioonid
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.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
.NET Standard 2.0, 2.1
UWP 10.0

See also