When I am calling Bitbucket's authorize API :
https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id=cjsdknkcndksdnan&scope=pullrequest:write
scope passed is pullrequest:write
I am seeing the below thing in the UI:
saanh_007 is requesting access to the following:
Is it expected behavior?
Hi @saanjh jain and welcome to the community!
The permissions you see on this page are the permissions you have granted to the OAuth consumer.
If you want to change them, you can edit the OAuth consumer and change its permissions.
Kind regards,
Theodora
ohh got it and the scope we pass in the /authorize call will decide what is the scope of the access Token.
Am i right?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @saanjh jain,
The scope of the access token is also determined by the permissions you have selected for the OAuth consumer, I don't believe it's possible to override them by adding scope in the URL https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=token
Kind regards,
Theodora
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.
Hi @saanjh jain,
I don't see scope documented as a query parameter with https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=token in our docs. Where did you see it used this way? Perhaps I am missing something.
The scopes documented here https://developer.atlassian.com/cloud/bitbucket/rest/intro/#scopes are referring to the permissions you set up for an OAuth consumer, an App password, Repository/Workspace/Project Access Tokens, or in an app descriptor if you are building an Atlassian Connect app.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With such URL:
https://bitbucket.org/site/oauth2/authorize?response_type=code&client_id=cjsdknkcndksdnan&scope=pullrequest:write
if I am passing incorrect scope. ex - scope=pullrequest:writ,
Getting error.
https://ids.ics.dev/ma/proxy/oauthcallback?error=invalid_scope&error_description=Unknown+scope%3A+pullrequest%3Awrit
Can you please recheck and confirm?
What is the difference between passing the scope in authorize call and setting the scope while we create an oAuth consumer?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @saanjh jain,
The scope you pass in the authorize call is not taken into account. The access token will have the permissions you have selected in the OAuth consumer.
Kind regards,
Theodora
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.