azure - 创建 API 以对 Azure Active Directory 的用户进行身份验证

标签 azure .net-core azure-active-directory

我正在尝试使用 .net core 创建 API,以对 Azure Active Directory 的用户进行身份验证并获取响应中的 token 。

用户将能够使用他们的用户名和密码向我的 api 发起发布请求,我将代表他们登录到 Azure Active Directory。

有什么建议我可以如何做到这一点吗?

最佳答案

尝试请求此授权响应。

POST http://login.microsoftonline.com/{tenant}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded

client_id={client_id}
&scope=user.read openid profile offline_access
&username={username}
&password={password}
&grant_type=password

更多详情,请参阅 here .

关于azure - 创建 API 以对 Azure Active Directory 的用户进行身份验证,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65825974/

相关文章:

azure - 如何将 Azure API 管理开发人员门户更改从一个实例发布到另一实例?

c# - 下载文件后如何从 azure blob 存储中删除文件

azure - Cosmos DB Change Feed 的多个使用者

asp.net-core - 点网核心 : What are the sha512 and shaPath properties used for in . deps.json

jwt - 如何在登录时在 JWT token 中从 Azure Active Directory 传递自定义扩展属性?

sql - Get-AzureADUser - ALL - PowerShell Slow 获取所有用户和对帐户进行更改的用户

php - 从 PHP Web 应用程序根据 Azure Active Directory 对用户进行身份验证

angular .net core api cors预检请求错误

linux - dotnet 命令找不到 .NET Core 2.1 的新安装

Angular 5 调用 Azure AD protected Web API 导致 CORS