語言

WSFederationAuthenticationModule.RedirectToIdentityProvider 方法

定義

將使用者重新導向至 Issuer 屬性所指定的安全性令牌服務 (STS),以使用 WS-Federation 通訊協定取得安全性令牌。

public:
 virtual void RedirectToIdentityProvider(System::String ^ uniqueId, System::String ^ returnUrl, bool persist);
public virtual void RedirectToIdentityProvider(string uniqueId, string returnUrl, bool persist);
abstract member RedirectToIdentityProvider : string * string * bool -> unit
override this.RedirectToIdentityProvider : string * string * bool -> unit
Public Overridable Sub RedirectToIdentityProvider (uniqueId As String, returnUrl As String, persist As Boolean)

參數

uniqueId
String

WSFAM 將此值儲存在 WS-Federation 登入請求的 wctx 參數中;然而,該模組在處理登入請求或登入回應時並不會使用該系統。 你可以設定成任何值。 這不需要是唯一的。 如需詳細資訊,請參閱 CreateSignInRequest(String, String, Boolean) 方法。

returnUrl
String

模組在認證時應回傳的網址。

persist
Boolean

WSFAM 將此值儲存在 WS-Federation 登入請求的 wctx 參數中;然而,該模組在處理登入請求或登入回應時並不會使用該系統。 你可以設定它或 truefalse。

例外狀況

Issuer 是 null 空字串。

-或-

Realm 是 null 空字串。

-或-

該 Current 物業是 null 空置的。

-或-

Response回傳的Current上下文屬性為 或 null 空。

備註

RedirectToIdentityProvider當請求由依賴方(RP)呈現的網頁發出時,或SignIn事件處理代理在授權失敗時被動重定向至身份提供者時,會從該OnEndRequest方法呼叫。

傳遞給方法的參數用來建立 wctx 訊息參數。 唯一重要的參數是參數。returnUrl 這會指定 RP 在成功驗證後應導向瀏覽器的 URL。 它不應與 wreply 訊息參數混淆,wreply 訊息參數由 Reply 屬性指定,並提供安全令牌服務(STS)應指向的 RP 位址。

此方法執行以下工作:

  1. 呼叫此 VerifyProperties 方法以確保模組能發出有效的登入請求。

  2. 從 CreateSignInRequest 模組設定的屬性中呼叫建立登入請求的方法。

  3. 啟動OnRedirectingToIdentityProvider該方法來提升事件。RedirectingToIdentityProvider 你可以取消重定向,或在事件處理器中修改這個事件的登入請求訊息。

適用於