AuthorizationMessageHandler.ConfigureHandler 方法

定義

設定此處理程式,以使用存取權杖來授權輸出 HTTP 要求。 只有在 至少有一個 authorizedUrls 是 的 RequestUri 基底時,才會附加存取權杖。

public Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthorizationMessageHandler ConfigureHandler (System.Collections.Generic.IEnumerable<string> authorizedUrls, System.Collections.Generic.IEnumerable<string> scopes = default, string returnUrl = default);
public Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthorizationMessageHandler ConfigureHandler (System.Collections.Generic.IEnumerable<string> authorizedUrls, System.Collections.Generic.IEnumerable<string>? scopes = default, string? returnUrl = default);
member this.ConfigureHandler : seq<string> * seq<string> * string -> Microsoft.AspNetCore.Components.WebAssembly.Authentication.AuthorizationMessageHandler
Public Function ConfigureHandler (authorizedUrls As IEnumerable(Of String), Optional scopes As IEnumerable(Of String) = Nothing, Optional returnUrl As String = Nothing) As AuthorizationMessageHandler

參數

authorizedUrls
IEnumerable<String>

要附加權杖之端點 URL 的基底位址。

scopes
IEnumerable<String>

要求存取權杖時要使用的範圍清單。

returnUrl
String

如果布建權杖時發生問題,則必須重新導向至識別提供者,才能使用傳回 URL。

傳回

這個 AuthorizationMessageHandler

適用於