繁体   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