Hi,
As per Documentation i am trying to add group to repository via access token and i am getting following error
curl --request PUT \ --url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/permissions-config/groups/{group_slug}' \ --header 'Authorization: Bearer <access_token>' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "permission": "read" }'
message": "This API is only accessible with the following authentication types: apppassword, session"}}
Documentation
The Bitbucket Cloud REST API (atlassian.com)
I tried to do the same with app password and its working, however i want to achieve this with access token for automation, providing app password for organization level is not good idea, if in future my account is deactivated this Api will fail with app password authentication.
Hello @Sachin !
Welcome to the Community!
Access tokens are indeed currently not supported in the Repository permissions endpoints, but we already have a feature request with our development team to add that authentication option to those endpoints :
We encourage you to Vote in that feature so our product managers can better understand the interest. If you would like to be notified whenever an update is posted on that feature, feel free to follow it by clicking on Start watching this issue option.
While that feature is not available, the authentication to the repository permissions endpoints are username and app password. One alternative is to create a new account to act as a "bot account" under which you can create the app password, so the password is not attached a an actual user account.
Thank you, @Sachin !
Patrik S
Thank you for the update, Pratik.
I have voted the same.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.