Represents a claims-based identity.
Assembly: mscorlib (in mscorlib.dll)
Thetype exposes the following members.
|ClaimsIdentity||Initializes a new instance of the class with an empty claims collection.|
|ClaimsIdentity(IEnumerable(Of Claim))||Initializes a new instance of the class using an enumerated collection of Claim objects.|
|ClaimsIdentity(IIdentity)||Initializes a new instance of the class using the name and authentication type from the specified IIdentity.|
|ClaimsIdentity(SerializationInfo)||Initializes a new instance of the class from a serialized stream created by using ISerializable.|
|ClaimsIdentity(String)||Initializes a new instance of the class with an empty claims collection and the specified authentication type.|
|ClaimsIdentity(IEnumerable(Of Claim), String)||Initializes a new instance of the class with the specified claims and authentication type.|
|ClaimsIdentity(IIdentity, IEnumerable(Of Claim))||Initializes a new instance of the class using the specified claims and the specified IIdentity.|
|ClaimsIdentity(SerializationInfo, StreamingContext)||Initializes a new instance of the class from a serialized stream created by using ISerializable.|
|ClaimsIdentity(String, String, String)||Initializes a new instance of the class with the specified authentication type, name claim type, and role claim type.|
|ClaimsIdentity(IEnumerable(Of Claim), String, String, String)||Initializes a new instance of the class with the specified, claims, authentication type, name claim type, and role claim type.|
|ClaimsIdentity(IIdentity, IEnumerable(Of Claim), String, String, String)||Initializes a new instance of the class from the specified IIdentity using the specified claims, authentication type, name claim type, and role claim type.|
|Actor||Gets or sets the identity of the calling party that was granted delegation rights.|
|AuthenticationType||Gets the authentication type.|
|BootstrapContext||Gets or sets the token that was used to create this claims identity.|
|Claims||Gets the claims associated with this claims identity.|
|IsAuthenticated||Gets a value that indicates whether the identity has been authenticated.|
|Label||Gets or sets the label for this claims identity.|
|Name||Gets the name of this claims identity.|
|NameClaimType||Gets the claim type that is used to determine which claims provide the value for the Name property of this claims identity.|
|RoleClaimType||Gets the claim type that will be interpreted as a .NET Framework role among the claims in this claims identity.|
|AddClaim||Adds a single claim to this claims identity.|
|AddClaims||Adds a list of claims to this claims identity.|
|Clone||Returns a new copied from this claims identity.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|FindAll(Predicate(Of Claim))||Retrieves all of the claims that are matched by the specified predicate.|
|FindAll(String)||Retrieves all of the claims that have the specified claim type.|
|FindFirst(Predicate(Of Claim))||Retrieves the first claim that is matched by the specified predicate.|
|FindFirst(String)||Retrieves the first claim with the specified claim type.|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetObjectData||Populates the SerializationInfo with data needed to serialize the current object.|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|HasClaim(Predicate(Of Claim))||Determines whether this claims identity has a claim that is matched by the specified predicate.|
|HasClaim(String, String)||Determines whether this claims identity has a claim with the specified claim type and value.|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|RemoveClaim||Attempts to remove a claim from the claims identity.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
|TryRemoveClaim||Attempts to remove a claim from the claims identity.|
The class is a concrete implementation of a claims-based identity; that is, an identity described by a collection of claims. A claim is a statement about an entity made by an issuer that describes a property, right, or some other quality of that entity. Such an entity is said to be the subject of the claim. A claim is represented by the Claim class. The claims contained in a describe the entity that the corresponding identity represents, and can be used to make authorization and authentication decisions. A claims-based access model has many advantages over more traditional access models that rely exclusively on roles. For example, claims can provide much richer information about the identity they represent and can be evaluated for authorization or authentication in a far more specific manner.
Beginning with .NET Framework 4.5, Windows Identity Foundation (WIF) and claims-based identity have been fully integrated into the .NET Framework. This means that many classes that represent an identity in the .NET Framework now derive from and describe their properties through a collection of claims. This is different from previous versions of the .NET Framework, in which, these classes implemented the IIdentity interface directly. The collection of claims that describe the identity can be accessed through the Claims property. The class provides several methods for finding and modifying claims and fully supports language integrated queries (LINQ). In application code, objects are typically accessed through ClaimsPrincipal objects; for example, the principal returned by Thread.CurrentPrincipal.
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 only in the cases where the principal contains more than one and you need to evaluate or modify a specific identity.
To add or remove claims from the Claims collection, a caller must have full trust.
In the claims-based model, the IIdentity.Name property and the IPrincipal.IsInRole(String) method are implemented by evaluating the claims contained by an identity. The base implementations in the claims-based model are provided by the ClaimsIdentity.Name property and the ClaimsPrincipal.IsInRole method. The NameClaimType and RoleClaimType properties enable you to specify a claim type that should be used to evaluate the claims contained by the identity when performing these operations.
Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.