WSFederationAuthenticationModule.SecurityTokenReceived 事件

定义

当安全标记已从安全标记服务 (STS) 获得时发生。

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

事件类型

示例

void WSFederationAuthenticationModule_SecurityTokenReceived(object sender, SecurityTokenReceivedEventArgs e)
{
    //Augment token validation with your cusotm validation checks without invalidating the token.
    System.Diagnostics.Trace.WriteLine("Handling SecurityTokenReceived event");
}

注解

可以添加事件处理程序以在验证令牌之前对其进行修改。 在事件处理程序中,可以通过 属性访问安全令牌 SecurityTokenReceivedEventArgs.SecurityToken 。 事件SecurityTokenReceived是可取消的事件,可以在事件处理程序中将 true 属性设置为 Cancel 以终止 WS-Federation 登录响应消息的处理。

处理从安全令牌服务 (STS) 收到的 WS-Federation 登录响应消息 (“wsignin1.0”) 时,会从事件处理程序委托内部 OnAuthenticateRequest 引发此事件。 它在从登录响应消息中的 wresult 或 wresultptr 参数反序列化安全令牌之后,但在验证安全令牌之前引发。

适用于

另请参阅