我可以将 grant_type=client_credentials 用于 google api 吗? [英] can I use grant_type=client_credentials for google api?
问题描述
我在谷歌控制台中创建了一个 clientid 和 clientcredentials.当我使用 grant_type=client_credentials
请求令牌时.我得到了 401 未授权
.
I create a clientid, and clientcredentials in google console. when I request the token with grant_type=client_credentials
. I got 401 unauthrorized
.
{
"error": "invalid_client",
"error_description": "Unauthorized",
"error_uri": ""
}
推荐答案
该错误表示您未通过身份验证.此外,client_credentials 不是我所知道的 grant_type 的有效值.
The error means that you are not authenticated. Also client_credentials is not a valid value for grant_type that I am aware of.
我所知道的只有
- authorization_code
- refresh_token
看起来 grant_type=client_credentials
是 RFC 用于 Oauth2,但我没有在 Google 身份验证服务器中看到它的实现.
It looks like grant_type=client_credentials
is part of the RFC for Oauth2 but its not something I have seen implemented in Googles Authentication servers.
Anwser:据我所知,您不能将 grant_type=client_credentials 与 Google API 一起使用.
Anwser: No to my knowledge you cant use grant_type=client_credentials with Google APis.
更新:刚刚从 Google 得到消息.我是对的,他们不支持这个 grant_type.
update: just got word back from Google. I was correct they do not support this grant_type.
这篇关于我可以将 grant_type=client_credentials 用于 google api 吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!