PHP Bitbucket API OAuth-2 unauthorized_client 错误
PHP Bitbucket API OAuth-2 unauthorized_client error
我正在尝试使用 OAuth-2 和 OAuth2 客户端脚本连接到 BitBucket API。
我进入重定向页面,其中显示 "Confirm access to your account",然后单击 "Grant access",它会将我重定向回我的回调 url。但是我收到一条错误消息,说 "unauthorized client" 和描述:
Client credentials missing; this request needs to be authenticated
with the OAuth client id and secret
我正在提供客户端 ID 和客户端密码,所以我不确定问题出在哪里。我已经搜索了一段时间这个主题,但信息有限。
如有任何帮助,我们将不胜感激。
我已经使用在 BitBucket 文档中找到的 curl 命令行解决了这个问题:
$ curl -X POST -u "client_id:secret" \
https://bitbucket.org/site/oauth2/access_token \
-d grant_type=authorization_code -d code={code}
我通过搜索找到的答案是 client_id 和 secret 被视为用户名和密码。起初这对我来说并不明显。使用 OAuth 客户端脚本似乎不适用于 BitBucket 的 OAuth2 版本。但是将 OAuth 1 与 BitBucket 一起使用没有任何问题。
希望这对遇到类似问题的人有所帮助。
你可以试试这个URL
$ curl -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=password -d username={username} -d password={password}
/// 这是 API 由 bitbucket
暴露的
在哪里
client_id :您的客户 ID(例如:75frt****)
secret : 你的密钥 (eg:8uyrioooreu*****)
用户名:
密码:
以上 URL 将更新为
$ curl -X POST -u "abc*******:123****"
https://bitbucket.org/site/oauth2/access_token -d grant_type=password
-d username={abc123@gmail.com} -d password={******}
注意:最初我在 'username' 字段中使用别名用户名,我遇到了错误 "Unauthorised client" 错误,后来当我将用户名更改为我注册的电子邮件 ID [abc123@gmail.com ], 效果很好。
希望对您有所帮助。
我正在尝试使用 OAuth-2 和 OAuth2 客户端脚本连接到 BitBucket API。
我进入重定向页面,其中显示 "Confirm access to your account",然后单击 "Grant access",它会将我重定向回我的回调 url。但是我收到一条错误消息,说 "unauthorized client" 和描述:
Client credentials missing; this request needs to be authenticated with the OAuth client id and secret
我正在提供客户端 ID 和客户端密码,所以我不确定问题出在哪里。我已经搜索了一段时间这个主题,但信息有限。
如有任何帮助,我们将不胜感激。
我已经使用在 BitBucket 文档中找到的 curl 命令行解决了这个问题:
$ curl -X POST -u "client_id:secret" \
https://bitbucket.org/site/oauth2/access_token \
-d grant_type=authorization_code -d code={code}
我通过搜索找到的答案是 client_id 和 secret 被视为用户名和密码。起初这对我来说并不明显。使用 OAuth 客户端脚本似乎不适用于 BitBucket 的 OAuth2 版本。但是将 OAuth 1 与 BitBucket 一起使用没有任何问题。
希望这对遇到类似问题的人有所帮助。
你可以试试这个URL
$ curl -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=password -d username={username} -d password={password}
/// 这是 API 由 bitbucket
暴露的在哪里 client_id :您的客户 ID(例如:75frt****) secret : 你的密钥 (eg:8uyrioooreu*****)
用户名: 密码:
以上 URL 将更新为
$ curl -X POST -u "abc*******:123****"
https://bitbucket.org/site/oauth2/access_token -d grant_type=password
-d username={abc123@gmail.com} -d password={******}
注意:最初我在 'username' 字段中使用别名用户名,我遇到了错误 "Unauthorised client" 错误,后来当我将用户名更改为我注册的电子邮件 ID [abc123@gmail.com ], 效果很好。
希望对您有所帮助。