InteractiveBrowserCredential 類別
開啟瀏覽器以互動方式驗證使用者。
<xref:azure.identity.get_token> 會開啟瀏覽器到 Azure Active Directory 提供的登入 URL,並使用 PKCE (Code) Exchange 的證明金鑰在內部驗證使用者,以保護程式碼。
- 繼承
-
azure.identity._internal.interactive.InteractiveCredentialInteractiveBrowserCredential
建構函式
InteractiveBrowserCredential(**kwargs: Any)
參數
- authority
- str
Azure Active Directory 端點的授權單位,例如「login.microsoftonline.com」,即 Azure 公用雲端的授權單位 (,這是預設) 。 AzureAuthorityHosts 定義其他雲端的授權單位。
- tenant_id
- str
Azure Active Directory 租使用者識別碼。 預設為可驗證公司或學校帳戶的「組織」租使用者。
- client_id
- str
Azure Active Directory 應用程式使用者的用戶端識別碼將會登入。 如果未指定,使用者將會向 Azure 開發應用程式進行驗證。
- login_hint
- str
預先填入登入頁面的使用者名稱/電子郵件地址欄位的使用者名稱建議。 使用者仍可使用不同的使用者名稱登入。
- redirect_uri
- str
azure Active Directory 中所設定 client_id 所識別之應用程式的重新導向 URI,例如 「 http://localhost:8400 」。 只有在傳遞 client_id的值,而且必須符合應用程式註冊中的重新導向 URI 時,才需要此專案。 認證必須能夠將通訊端系結至此 URI。
- authentication_record
- AuthenticationRecord
AuthenticationRecord 傳回者 <xref:azure.identity.authenticate>
- disable_automatic_authentication
- bool
如果為 True, <xref:azure.identity.get_token> 則會在需要使用者互動才能取得權杖時引發 AuthenticationRequiredError 。 預設為 False。
- cache_persistence_options
- TokenCachePersistenceOptions
持續性權杖快取的組態。 如果未指定,認證將會快取記憶體中的權杖。
- timeout
- int
等候使用者完成驗證的秒數。 預設為 300 (5 分鐘) 。
意見反應
提交並檢視相關的意見反應