簡體   English   中英

使用 Azure Active Directory 作為身份驗證方法時,SqlClient 如何獲取 Azure SQL 服務器的“范圍”?

[英]How does SqlClient gets 'scope' of Azure SQL Server when using Azure Active Directory as authentication method?

As I understand that for getting selective authorization for a protected resource using Azure AD based OAuth 2.0 mechanism, client application need to mandatorily provide the scope URL for getting access token. 其他參數通常包括客戶端 ID、客戶端密碼(在服務主體身份驗證流的情況下)、Azure AD 用戶名和密碼等。

SqlClient 已將 Azure AD OAuth 機制與 SqlClient 集成,用於授權數據庫連接。 所以,我猜 SqlClient 也需要這些參數來使用 Azure Active Directory 身份驗證方法建立與 Azure SQL 服務器的連接。 但我沒有看到它接受來自客戶端應用程序的任何 scope。 SqlClient 如何為特定的 Azure SQL 服務器實例獲取 scope? 我看到它從服務器獲得了聯合身份驗證信息,但我不完全理解。

The scope required for SQL Servder Authentication access tokens is https://database.windows.net/.default which stands for default scopes/permissions for https://database.windows.net/ resource.

獲得訪問令牌后,您通過SqlConnection.AccessToken屬性將其傳遞。

干杯

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM