gpt4 book ai didi

onedrive - 错误 : Public clients can't send a client secret while try to get access token in Onedrive

转载 作者:行者123 更新时间:2023-12-01 09:50:27 28 4
gpt4 key购买 nike

我正在尝试通过以下 URL 获取 OneDrive 访问 token

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":"Public clients can't send a client secret."}



谁能解释一下?

最佳答案

“公共(public)客户端”是移动或桌面应用程序(Web 服务是“ secret 客户端”)。 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

关于onedrive - 错误 : Public clients can't send a client secret while try to get access token in Onedrive,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38786249/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com