Bridge For Git Bitbucket login "scope+used+in+the+request+is+not+valid+..."
search cancel

Bridge For Git Bitbucket login "scope+used+in+the+request+is+not+valid+..."

book

Article ID: 423883

calendar_today

Updated On:

Products

Endevor

Issue/Introduction

Endevor Bridge for Git (BFG) 2.15.10.
Running under port 8081 and configured to connect to Bitbucket.

When using "Log in with Bitbucket" encounter this in the address bar:

https://bfg.example.com:8081/oauth2/callback/bitbucket?error=invalid_scope&error_description=The+scope+used+in+the+request+['PUBLIC_REPOS+REPO_ADMIN+REPO_READ+REPO_WRITE']+is+not+valid+for+client+scope+['PUBLIC_REPOS+REPO_READ+REPO_WRITE']&state=...

Environment

Endevor Bridge For Git

Cause

The message means the requested scope is not matching what is configured in Bitbucket.

Resolution

Request Bitbucket admin to make sure Admin is selected in the Bitbucket Repositories permissions for BFG per: Administrating > Mapping Administration > Git Provider Permissions Requirements
Admin includes all Read and Write capabilities so only Admin needs to be set.

Additional Information

BFG needs admin access to the repository in order to create a webhook subscription. Note that without that Bitbucket webhook the synchronisation is not going to work and so is essential for the correct function of the product. 
Also this permission is not extending scope of existing privileges i.e. it is not giving admin access to anyone who does not have it already. This specific setting is just saying that if a user has admin access already, the token generated by BFG will have admin access as well, aka BFG will be able to perform admin actions on behalf of users (that are admins already).
It is still up to the Bitbucket admin to decide each user's level of access to which repositories.