Export (0) Print
Expand All

ClaimsIdentity Constructor (IIdentity, IEnumerable(Claim))

.NET Framework 4.5

Initializes a new instance of the ClaimsIdentity class using the specified claims and the specified IIdentity.

Namespace:  System.Security.Claims
Assembly:  mscorlib (in mscorlib.dll)

new : 
        identity:IIdentity * 
        claims:IEnumerable<Claim> -> ClaimsIdentity

Parameters

identity
Type: System.Security.Principal.IIdentity

The identity from which to base the new claims identity.

claims
Type: System.Collections.Generic.IEnumerable(Claim)

The claims with which to populate the claims identity.

The following table shows initial property values for an instance of the ClaimsIdentity class.

Property

Value

Actor

If identity is assignable from ClaimsIdentity, the value of the identity.Actor property; otherwise, a null reference (Nothing in Visual Basic).

AuthenticationType

The authenticationType parameter. If the authenticationType parameter is a null reference (Nothing in Visual Basic) or an empty string, the value of the identity.AuthenticationType (IIdentity.AuthenticationType) property is used.

BootstrapContext

If identity is assignable from ClaimsIdentity, the value of the identity.BootStrapContext property; otherwise, a null reference (Nothing in Visual Basic).

Claims

Initialized from the claims parameter. If identity is assignable from ClaimsIdentity, the claims from identity are added to the new instance before those specified by the claims parameter.

IsAuthenticated

NoteNote

When accessed, the value of the IsAuthenticated property is returned based on the value of the AuthenticationType property.

Label

If identity is assignable from ClaimsIdentity, the value of the identity.Label property; otherwise, a null reference (Nothing in Visual Basic).

Name

If identity is not assignable from ClaimsIdentity, is not a null reference (Nothing in Visual Basic), and has an IIdentity.Name property that is not a null reference (Nothing in Visual Basic); a name claim is added to the new instance using the value of the IIdentity.Name property.

NoteNote

When accessed, the value of the Name property is returned based on the NameClaimType and the Claims collection.

NameClaimType

If identity is assignable from ClaimsIdentity, the value of the identity.NameClaimType property is used; otherwise, DefaultNameClaimType is used.

RoleClaimType

If identity is assignable from ClaimsIdentity, the value of the identity.RoleClaimType property is used; otherwise, DefaultRoleClaimType is used.

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5

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.

Show:
© 2014 Microsoft