Edit

Share via


WSFederationAuthenticationModule.SetPrincipalAndWriteSessionToken Method

Definition

Sets the thread principal and optionally writes the session cookie.

public:
 void SetPrincipalAndWriteSessionToken(System::IdentityModel::Tokens::SessionSecurityToken ^ sessionToken, bool isSession);
public void SetPrincipalAndWriteSessionToken (System.IdentityModel.Tokens.SessionSecurityToken sessionToken, bool isSession);
member this.SetPrincipalAndWriteSessionToken : System.IdentityModel.Tokens.SessionSecurityToken * bool -> unit
Public Sub SetPrincipalAndWriteSessionToken (sessionToken As SessionSecurityToken, isSession As Boolean)

Parameters

sessionToken
SessionSecurityToken

The session security token that was created from the WS-Federation sign-in response message from the STS.

isSession
Boolean

true to write a cookie that represents the session included with the response; otherwise, false.

Exceptions

sessionToken is null.

Remarks

Called from the request processing pipeline implemented in the OnAuthenticateRequest event-handler delegate. This method does the following:

  1. Invokes the OnSessionSecurityTokenCreated method to raise the SessionSecurityTokenCreated event. You can use this event to modify the session token before it is used to set the thread principal and written to the session cookie and to specify whether the session cookie should be written.

  2. Invokes the AuthenticateSessionSecurityToken method on the configured session authentication module (SessionAuthenticationModule) to set the thread principal and optionally write the session cookie.

Applies to

See also