Export (0) Print
Expand All

SessionSecurityToken Constructor (ClaimsPrincipal, String)

.NET Framework 4.5

Initializes a new instance of the SessionSecurityToken class from the specified principal and bootstrap token.

Namespace:  System.IdentityModel.Tokens
Assembly:  System.IdentityModel (in System.IdentityModel.dll)

public SessionSecurityToken(
	ClaimsPrincipal claimsPrincipal,
	string context
)

Parameters

claimsPrincipal
Type: System.Security.Claims.ClaimsPrincipal

The claims principal that was generated from the bootstrap token.

context
Type: System.String

An optional, application-specific context string.

ExceptionCondition
ArgumentNullException

claimsPrincipal is null.

-or-

The Identities property of claimsPrincipal is null.

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

Property

Initial Value

ClaimsPrincipal

claimsPrincipal

Context

context

ContextId

Set to a generated unique ID.

EndpointId

String.Empty

Id

Set to a generated unique ID.

IsPersistent

false

IsReferenceMode

false

KeyEffectiveTime

UtcNow

KeyExpirationTime

UtcNow plus the SessionSecurityTokenHandler.DefaultTokenLifetime property.

KeyGeneration

null

SecurityKeys

Contains a generated 128 bit symmetric key.

NoteNote

The default implementation does not use this property. Signing and encryption keys are dictated by the cookie transforms applied by the SessionSecurityTokenHandler that processes the token.

ValidFrom

UtcNow

ValidTo

UtcNow plus the SessionSecurityTokenHandler.DefaultTokenLifetime property.

.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