Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateSessionSecurityToken Method

SessionSecurityTokenHandler.CreateSessionSecurityToken Method

.NET Framework 4.6 and 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.6, 4.5
Show:
© 2015 Microsoft