次の方法で共有


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

注釈

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

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

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

適用対象