WSFederationAuthenticationModule.SessionSecurityTokenCreated 이벤트

정의

이 이벤트는 STS(보안 토큰 서비스)에서 수신된 보안 토큰으로부터 세션 보안 토큰이 만들어졌을 때 발생합니다.

public:
 event EventHandler<System::IdentityModel::Services::SessionSecurityTokenCreatedEventArgs ^> ^ SessionSecurityTokenCreated;
public event EventHandler<System.IdentityModel.Services.SessionSecurityTokenCreatedEventArgs> SessionSecurityTokenCreated;
member this.SessionSecurityTokenCreated : EventHandler<System.IdentityModel.Services.SessionSecurityTokenCreatedEventArgs> 
Public Custom Event SessionSecurityTokenCreated As EventHandler(Of SessionSecurityTokenCreatedEventArgs) 
Public Event SessionSecurityTokenCreated As EventHandler(Of SessionSecurityTokenCreatedEventArgs) 

이벤트 유형

예제

void WSFederationAuthenticationModule_SessionSecurityTokenCreated(object sender, SessionSecurityTokenCreatedEventArgs e)
{
    //Manipulate session token here, for example, changing its expiration value
    System.Diagnostics.Trace.WriteLine("Handling SessionSecurityTokenCreated event");
    System.Diagnostics.Trace.WriteLine("Key valid from: " + e.SessionToken.KeyEffectiveTime);
    System.Diagnostics.Trace.WriteLine("Key expires on: " + e.SessionToken.KeyExpirationTime);
}

설명

스레드 주체를 설정하는 데 사용되고 세션 쿠키에 기록되기 전에 세션 토큰을 수정하는 이벤트 처리기를 추가할 수 있습니다. 이벤트 처리기에서 속성을 통해 세션 토큰에 SessionSecurityTokenCreatedEventArgs.SessionToken 액세스할 수 있습니다. 속성을 설정 SessionSecurityTokenCreatedEventArgs.WriteSessionCookie 하여 세션 쿠키를 작성할지 여부를 지정할 수 있습니다.

이 이벤트는 STS(보안 토큰 서비스)에서 받은 WS-Federation 로그인 응답 메시지("wsignin1.0")를 처리할 때 이벤트 처리기 대리자 내부에서 OnAuthenticateRequest 발생합니다. 이는 wresult 또는 로그인 응답 메시지의 wresultptr 매개 변수에서 역직렬화된 보안 토큰이 유효성을 검사한 후 및 클레임 보안 주체가 (및 의 HttpContext.Current속성에 Thread.CurrentPrincipalUser 대해) 설정되기 직전에 발생합니다.

중요

참조 모드에서 세션을 작동하려면 global.asax.cs 파일에서 이벤트에 대한 WSFederationAuthenticationModule.SessionSecurityTokenCreated 처리기를 제공하고 속성에 전달된 SessionSecurityTokenCreatedEventArgs.SessionToken 토큰에서 속성을 설정하는 SessionSecurityToken.IsReferenceMode 것이 좋습니다. 이렇게 하면 세션 토큰이 모든 요청에 대해 참조 모드로 작동 하 고 단순히 설정 보다 우선 하는 SessionAuthenticationModule.IsReferenceMode 세션 인증 모듈의 속성입니다.

적용 대상