ClaimsIdentity.Claims 属性

定义

获取与此声明标识关联的声明。Gets the claims associated with this claims identity.

public:
 virtual property System::Collections::Generic::IEnumerable<System::Security::Claims::Claim ^> ^ Claims { System::Collections::Generic::IEnumerable<System::Security::Claims::Claim ^> ^ get(); };
public virtual System.Collections.Generic.IEnumerable<System.Security.Claims.Claim> Claims { get; }
member this.Claims : seq<System.Security.Claims.Claim>
Public Overridable ReadOnly Property Claims As IEnumerable(Of Claim)

属性值

IEnumerable<Claim>

与此声明标识相关联的声明的集合。The collection of claims associated with this claims identity.

注解

集合可以包含的项 nullThe collection may contain entries that are null.

集合中包含的声明 Claims 实质上描述由表示的实体 ClaimsIdentityThe 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.

备注

ClaimsPrincipalClaims 还具有属性。The ClaimsPrincipal class has a Claims property as well. 在大多数情况下,你应该通过 ClaimsPrincipal.Claims 集合而不是通过集合来访问用户的声明 ClaimsIn the majority of cases you should access the user's claims through the ClaimsPrincipal.Claims collection rather than through the Claims collection. ClaimsIdentity仅当主体包含多个 ClaimsIdentity ,并且需要评估或修改特定标识时,才需要访问单个的声明。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.

适用于

另请参阅