azure-active-directory - 尝试从 Microsoft API 获取令牌时出现错误“invalid_client”
问题描述
我正在尝试在windev程序中开发驱动解决方案(Onedrive)。
我在 Microsoft Azure 中创建了一个应用程序并创建了一个密钥。
在执行第一个请求时https://login.live.com/oauth20_authorize.srf?client_id={client_id}&scope={scope} &response_type=code&redirect_uri={redirect_uri}
,我在连接页面上被重定向。
连接后,我会返回一个代码https://login.live.com/oauth20_authorize.srf?code={code}.
但是,当我要求发布此请求的令牌时:POST https://login.live.com/oauth20_token.srf Content-Type: application/x-www-form-urlencoded client_id={client_id}&redirect_uri={redirect_uri}&client_secret={client_secret} &code={code}&grant_type=authorization_code
我把这个拿回来
{ "error":"invalid_client", "error_description":"The client does not exist or is not enabled for consumers. If you are the application developer, configure a new application through the App Registrations in the Azure Portal at https:\/\/go.microsoft.com\/fwlink\/?linkid=2083908.", "correlation_id":"471e800c-69b4-43c6-a03f-a1f7e9512e6b" }
感谢您的帮助。
解决方案
此错误表示您正在使用 Microsoft 帐户登录您的客户端应用程序,但未为此启用它。
要更改现有 AD 应用程序的设置,请导航到门户中它的Manifest刀片,找到signInAudience属性,使用AzureADandPersonalMicrosoftAccount
或进行设置PersonalMicrosoftAccount
。
推荐阅读
- rust - 如何从 Wasm 内存缓冲区中读取元组结构?
- node.js - 在 MERN 堆栈应用程序中将前端连接到后端
- python - 我如何在python中杀死这个线程
- git - 链接 git clean (Porcelain) 命令
- firebase - 我应该如何分离firebase项目?
- python - 如何使用 pip 安装所有依赖项?
- php - OO MySqli 使用准备好的语句引发错误
- google-apps-script - getSheetByName 不在 setActiveSpreadsheet 上工作,但在 Google App Script 中的 getActiveSpreadsheet 上工作
- gatsby - 如何在 gatsby 应用程序中集成 Headway 变更日志?
- android - 如何在android中选择目录