azure-active-directory - 无法使用用户名和密码获取 Microsoft Graph API OAuth 2.0 的 access_token

标签 azure-active-directory microsoft-graph-api

我正在尝试使用access_token获取

POST https://login.microsoftonline.com/ {租户}/oauth2/v2.0/ token

使用用户名和密码的端点,其中tenant = {sometenant id}

我用来发出请求的参数是:

client_id:{client_id}
scope:https://graph.microsoft.com/Calendars.ReadWrite
client_secret:{client_secret}
username:{username}
password:{password}
grant_type:password

我收到以下响应错误:

error: invalid_request
error_description : AADSTS90002: Tenant '' not found. This may happen if there are no active subscriptions for the tenant. Check with your subscription administrator.

我对 Azure 上的应用程序拥有以下权限: enter image description here

此处提供了相关文档:https://learn.microsoft.com/en-us/azure/active-directory/develop/v2-oauth-ropc

最佳答案

在我这边,它有效。您应该检查您的租户,您的应用程序是否已在此租户中注册。

enter image description here

关于azure-active-directory - 无法使用用户名和密码获取 Microsoft Graph API OAuth 2.0 的 access_token,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54868429/

相关文章:

python - 如何在 Azure 中检索客户端 ID 和 secret 以用于创建和销毁虚拟机?

c# - 为什么 Blazor 服务器端应用程序中返回的访问 token 为 null?

azure - 从 terraform 创建服务主体时出现权限不足,无法完成操作的错误

office-js - 通过 Microsoft Graph 在 Outlook 加载项中设置自定义属性

Azure Graph API - 添加自定义签名 key - 证书无效 : Key value is invalid certificate

azure - 如何让 New-AzureADPolicy 在 azure cloud shell 中工作

php - 如何将 Azure AD 集成到使用 AWS Cognito 实现 SSO 的应用程序中?

office365 - Microsoft Graph API 邮件办公室 365 : Is any option create inbox message NOT as Draft?

node.js - 范围/角色声明在客户端凭据访问 token 中不可用

azure - 更改邀请电子邮件: Azure AD中inviteRedeemUrl的导航