共用方式為


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 是可取消的事件,您可以在事件處理程式中將 Cancel 屬性設定為 true ,以終止處理 WS-Federation 登入回應消息。

處理 (從 STS) 收到 WS-Federation 登入回應消息 (“wsignin1.0”) 時,事件處理程式委派內 OnAuthenticateRequest 會引發此事件。 它會在從登入回應消息中的 wresult 或 wresultptr 參數還原串行化安全性令牌之後引發,但在驗證安全性令牌之前。

適用於

另請參閱