I have been following: https://confluence.atlassian.com/bitbucketserver0720/bitbucket-oauth-2-0-provider-api-1116282017.html to login to my bitbucket repository, but am consistently getting told by bitbucket's api that I am missing client credentials (including client_secret, which PKCE should not need).
Here is my setup:
Here is my understanding of the flow:
#1 and @#2 work - I get a code back, but site/oauth2/access_token expects a client id and secret - does PKCE not work for bb.org?
Hello @Brandon G and welcome to Atlassian Community!
I'm afraid the documentation you linked is for Bitbucket Server and not Bitbucket Cloud.
The Bitbucket Cloud API does not currently offer the Proof Key for Code Exchange (PKCE) so this is the reason why you are receiving that error.
In order to exchange the authorization code for an access token you will need to call the below endpoint :
curl -X POST -u "client_id:secret" https://bitbucket.org/site/oauth2/access_token -d grant_type=authorization_code -d code={code}
Where the client_id and secret are the values from the OAuth consumer you have created under your bitbucket workspace.
For more details on the available authentication methods for Bitbucket Cloud API, you can refer to the following documentation :
Thank you, @Brandon G !
Patrik S
Thanks and got it! I am building a client side application that has an embedded web server to handle callbacks but was hoping to use pkce so that I didn't have to use the implicit grant flow or store the client secret within my application. Not a huge deal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Patrik S
Thanks for clarifying the distinction between Bitbucket Server and Bitbucket Cloud, I was also looking at the wrong documentation!
Are there any plans to add PKCE support for Bitbucket Cloud?
I see that Implicit Grant is supported "for browser-based add-ons that operate without server-side backends" which is great, but my understanding is that PKCE would be more secure for this purpose.
This article titled "Implicit Flow is Dead, Try PKCE Instead" says:
"For native and browser-based JavaScript apps, it is now widely considered a best practice to use the Authorization Code flow with the PKCE extension, instead of the Implicit flow."
Thank you!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Jim Fisk ,
There's not currently plans on introducing the support for PKCE flow, but I went ahead and raised a feature request with our engineering team to include this functionality:
We encourage you to add your Vote there to express your interest, and also include a comment with your use-case so our product management team can better understand the context. By setting yourself as a watcher in that ticket, you'll also be notified by email of any future updates towards its implementation.
Thank you, @Jim Fisk !
Patrik S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.