azure - Azure Web API 的身份验证 token

标签 azure authentication asp.net-web-api azure-active-directory

我在使用 token 访问 Azure Web API 时遇到问题。我关注了this documentation from Microsoft

我可以通过向授权 token 端点发出 POST 请求来成功请求访问 token :

https://login.microsoftonline.com/{Tenant ID}/oauth2/token

我的帖子正文:

client_id:( Web API client ID )
client_secret:( Web API client Secret )
grant_type:password
username:userName
password:*******
resource:sharepoint.com

我正在使用 POSTMAN 来测试我的调用,当我尝试使用上面返回的 token 访问我的 API 时,我收到 401 未经授权。

最佳答案

我的 Web 配置文件中存在配置问题。

关于azure - Azure Web API 的身份验证 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36895139/

相关文章:

entity-framework - Azure EF Code First 迁移初始化程序

mysql - 在 Nodejs 中没有关于任何其他用户的最后发布信息

authentication - 在 .NET Core API 集成测试中使用正确的身份验证方案

android - 在 volley 中接收带有 json 请求的 bool 变量

c# - 如何在 Azure 中保留文件而不覆盖

Azure CDN 未正确提供我的 .html

authentication - SSL 究竟如何与非对称算法一起工作?

c# - 使用 POST 从 .NET 客户端向 REST API 发送 cookie

asp.net-web-api - 如何将 $expand 属性放入 ODATA 的 groupby 查询中

c# - 调试 Http 触发器 Azure Function VS 2017