问题描述
我正在尝试在 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
或 { {1}}。