簡體   English   中英

嘗試從 Microsoft API 獲取令牌時出現“invalid_client”錯誤

[英]Error "invalid_client" when trying to get a token from Microsoft API

我正在嘗試在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屬性,使用AzureADandPersonalMicrosoftAccountPersonalMicrosoftAccount進行設置。

在此處輸入圖像描述

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM