Export (0) Print
Expand All

SessionSecurityTokenHandler.CreateSessionSecurityToken Method

.NET Framework 4.5

Creates a SessionSecurityToken based on the specified claims principal and time range during which the token is valid.

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

public virtual SessionSecurityToken CreateSessionSecurityToken(
	ClaimsPrincipal principal,
	string context,
	string endpointId,
	DateTime validFrom,
	DateTime validTo
)

Parameters

principal
Type: System.Security.Claims.ClaimsPrincipal

The claims principal.

context
Type: System.String

A caller-defined context string.

endpointId
Type: System.String

The identifier of the endpoint to which the token is scoped.

validFrom
Type: System.DateTime

The time instant at which the token becomes valid.

validTo
Type: System.DateTime

The time instant after which the token is no longer valid.

Return Value

Type: System.IdentityModel.Tokens.SessionSecurityToken
The session security token that was created. The properties on the new session token are set according to the specified parameters.

ExceptionCondition
ArgumentNullException

principal is null.

InvalidOperationException

The Configuration property is null.

.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