Mryqu's Notes


  • 首页

  • 搜索
close

OneDrive认证时的"Public clients can't send a client secret."错误

时间: 2016-10-14   |   分类: DataBuilder     |   阅读: 23 字 ~1分钟

在进行Microsoft OneDrive认证和登录实验的过程中,曾经用下列命令过去访问令牌:

POST https://login.live.com/oauth20_token.srf
Content-Type: application/x-www-form-urlencoded

client_id={client_id}&redirect_uri=https://login.live.com/oauth20_desktop.srf&client_secret={client_secret}
&code={code}&grant_type=authorization_code

结果返回:

{"error":"invalid_request","error_description":"Public clients can't send a client secret."}

一个"public client"指的是移动或桌面应用(web服务则是"confidentialclient")。由于跳转URI是https://login.live.com/oauth20_desktop.srf,因而MSA返回该错误响应。这种情况下,不应该提供client_secret,使用下列请求即可。

POST https://login.live.com/oauth20_token.srf
Content-Type: application/x-www-form-urlencoded

client_id={client_id}&redirect_uri=https://login.live.com/oauth20_desktop.srf&code={code}&grant_type=authorization_code

标题:OneDrive认证时的"Public clients can't send a client secret."错误
作者:mryqu
声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!

#onedrive# #authentication# #public# #client# #secret#
Microsoft OneDrive API访问速率限制
Microsoft OneDrive认证和登录
  • 文章目录
  • 站点概览

Programmer & Architect

662 日志
27 分类
1472 标签
GitHub Twitter FB Page
© 2009 - 2023 Mryqu's Notes
Powered by - Hugo v0.120.4
Theme by - NexT
0%