2016-08-05 39 views
2

我想通過以下網址錯誤:公共客戶端不能發送客戶端密鑰,而試圖獲得訪問令牌Onedrive

https://login.live.com/oauth20_token.srf?client_id=YOUR_CLIENT_ID&client_secret=YOUR_CLIENT_SECRET&redirect_uri=https://login.live.com/oauth20_desktop.srf&code=AUTHORIZATION_CODE&grant_type=authorization_code

得到OneDrive訪問令牌,但響應如下

{「error」:「invalid_request」,「error_description」:「公共客戶端無法發送客戶端密鑰。」}

任何人都可以解釋這一點。

+0

你創建一個Web應用程序,移動/桌面應用程序,或者只是與實驗API? –

回答

5

「公共客戶端」是一個移動或桌面應用程序(Web服務是「機密客戶端」)。 MSA正在給你這個迴應,因爲你正在重定向到https://login.live.com/oauth20_desktop.srf。在這種情況下,你不應該在請求提供client_secret值,所以你的要求應該僅僅是這樣的:

https://login.live.com/oauth20_token.srf?client_id=YOUR_CLIENT_ID&redirect_uri=https://login.live.com/oauth20_desktop.srf&code=AUTHORIZATION_CODE&grant_type=authorization_code

相關問題