Share via


WSFederationAuthenticationModule.RedirectingToIdentityProvider イベント

定義

モジュールが ID プロバイダーにユーザーをリダイレクトしようとしているときに発生します。

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

イベントの種類

次のコードは、global.asax ファイルの イベントに Application_Init イベントのハンドラーRedirectingToIdentityProviderを追加する方法を示しています。 コードはサンプルから取得されます FederationForWebApps 。 このサンプルの詳細については、「WIF コード サンプル インデックス」を参照してください。

次のコードは、RP の global.asax ファイル内の イベントのハンドラー RedirectingToIdentityProvider を示しています。 このコードでは、受信 HTTP 要求に whr パラメーターが含まれているかどうかを確認し、含まれている場合は、STS に送信される WS-Federation サインイン要求にこのパラメーターを設定します。 コードはサンプルから取得されます FederationForWebApps 。 このサンプルの詳細については、「WIF コード サンプル インデックス」を参照してください。

次のコードは、フェデレーション プロバイダー STS の RedirectingToIdentityProvider global.asax ファイル内の イベントのハンドラーを示しています。 このコードは、受信 HTTP 要求に whr パラメーターが含まれているかどうかを確認します。 要求に whr パラメーターが含まれている場合、クライアントはサインインのために IP-STS に転送されます。そうでない場合、クライアントはホーム領域検出ページに移動して、サインインする IP-STS を選択します。 コードはサンプルから取得されます FederationForWebApps 。 このサンプルの詳細については、「WIF コード サンプル インデックス」を参照してください。

注釈

WS-Federation サインイン要求にアクセスして変更するには、 プロパティを RedirectingToIdentityProviderEventArgs.SignInRequestMessage 使用します。 たとえば、サインイン メッセージの プロパティを BaseUri 変更して、要求のリダイレクト先の ID プロバイダーを変更できます。 イベントは RedirectingToIdentityProvider 取り消し可能なイベントであり、 プロパティを Canceltrue 設定してリダイレクトを取り消すことができます。

イベントは、 メソッドの RedirectToIdentityProvider 呼び出し OnRedirectingToIdentityProvider を介して メソッド内から発生します。

ASP.NET アプリケーションでこのイベントを処理するには、global.asax ファイルで というメソッド WSFederationAuthentication_RedirectingToIdentityProvider を作成します。

適用対象