PublicClientApplication.AcquireTokenInteractive 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
重要
此 API 不符合 CLS 規範。
互動式請求以取得指定範圍的令牌。 互動視窗會被子視窗控制到指定的視窗。 使用者需選擇一個帳號。
[System.CLSCompliant(false)]
public Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder AcquireTokenInteractive(System.Collections.Generic.IEnumerable<string> scopes);
[<System.CLSCompliant(false)>]
abstract member AcquireTokenInteractive : seq<string> -> Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder
override this.AcquireTokenInteractive : seq<string> -> Microsoft.Identity.Client.AcquireTokenInteractiveParameterBuilder
Public Function AcquireTokenInteractive (scopes As IEnumerable(Of String)) As AcquireTokenInteractiveParameterBuilder
參數
- scopes
- IEnumerable<String>
請求存取受保護 API 的範圍
傳回
一個建構器,讓你在執行 token 請求前能加入可選參數
實作
- 屬性
備註
如果需要,使用者會互動登入,並且同意範圍設定,並在 Azure AD 租戶啟用多重驗證時進行此類驗證。
你也可以透過呼叫以下方式傳遞可選參數:
WithPrompt(Prompt) 例如指定登入時的使用者體驗、 WithUseEmbeddedWebView(Boolean) 指定使用嵌入式瀏覽器還是系統預設瀏覽器、 WithSystemWebViewOptions(SystemWebViewOptions) 設定使用預設瀏覽器時的使用者體驗, WithAccount(IAccount) 或 WithLoginHint(String) 防止在登入特定帳號時出現「選擇帳號」對話框,若 WithExtraScopesToConsent(IEnumerable<String>) 你想讓使用者預先同意額外範圍(這些範圍不會在存取權杖中回傳), Microsoft.Identity.Client.AbstractAcquireTokenParameterBuilder`1.WithExtraQueryParameters(System.Collections.Generic.Dictionary{System.String,System.String}) 將額外的查詢參數傳遞給 STS,以及其中一個覆寫 WithAuthority(String, Boolean) ,以覆蓋應用程式建構時預設權限設定。 請注意,優先權限必須是加入申請結構的已知權限的一部分。