错误:公共客户端在尝试获取Onedrive中的访问令牌时无法发送客户端密钥

时间:2016-08-05 09:48:06

标签: onedrive

我正在尝试通过以下网址获取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

但响应如下

{“error”:“invalid_request”,“error_description”:“公共客户端无法发送客户端密码。”}

任何人都可以解释这个。

1 个答案:

答案 0 :(得分:7)

A"公共客户"是一个移动或桌面应用程序(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

相关问题