SessionSecurityTokenHandler.CreateSessionSecurityToken Method (ClaimsPrincipal, String, String, DateTime, DateTime)

.NET Framework (current version)
 

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.

Exception Condition
ArgumentNullException

principal is null.

InvalidOperationException

The Configuration property is null.

.NET Framework
Available since 4.5
Return to top
Show: