如何从 BitBucket OAuth 中获取令牌?

3
我正在按照文档中的说明通过我的OAuth应用程序获取令牌,但我总是收到以下错误:

{"error_description": "Invalid OAuth client credentials", "error":"unauthorized_client"}

我的操作如下:1.我收到代码:

https://bitbucket.org/site/oauth2/authorize?client_id={my_application_key}&response_type=code

2.我想为此代码接收一个令牌:

curl -X POST -u "client_id: my_application_secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code={code}

我可能漏掉了什么吗?
1个回答

6

请将所有的client_id和secret替换为从Bitbucket设置的OAuth生成的consumer key和consumer secret。

当您成功授权集成应用程序并通过https://bitbucket.org/site/oauth2/access_token生成access_token时,您应该会收到一个access_token。


需要明确的是,问题在于文档没有清楚地指示要替换的常量。在 -u client_id:secret 中,您应该放置您的 ConsumerKey 和 ConsumerSecret。 - saraf.gahl
如何在Postman中使用“-u client_id:secret”? - Tuan Nguyen

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接