Rediger

Del via


SessionAuthenticationModule.CreateSessionSecurityToken Method

Definition

Creates a SessionSecurityToken from the specified parameters by using the configured session token handler.

public:
 System::IdentityModel::Tokens::SessionSecurityToken ^ CreateSessionSecurityToken(System::Security::Claims::ClaimsPrincipal ^ principal, System::String ^ context, DateTime validFrom, DateTime validTo, bool isPersistent);
public System.IdentityModel.Tokens.SessionSecurityToken CreateSessionSecurityToken (System.Security.Claims.ClaimsPrincipal principal, string context, DateTime validFrom, DateTime validTo, bool isPersistent);
member this.CreateSessionSecurityToken : System.Security.Claims.ClaimsPrincipal * string * DateTime * DateTime * bool -> System.IdentityModel.Tokens.SessionSecurityToken
Public Function CreateSessionSecurityToken (principal As ClaimsPrincipal, context As String, validFrom As DateTime, validTo As DateTime, isPersistent As Boolean) As SessionSecurityToken

Parameters

principal
ClaimsPrincipal

The principal to be captured in the token.

context
String

An application-defined context string.

validFrom
DateTime

The first instant in which this token is valid.

validTo
DateTime

The last instant in which this token is valid.

isPersistent
Boolean

true if the value should be persisted by the user agent; otherwise, false.

Returns

The session token.

Exceptions

There is not a valid session token handler configured. (There is no SessionSecurityTokenHandler configured in the SecurityTokenHandlers property.)

Applies to