我正在尝试使用 .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/