Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

This endpoint does not support token-based authentication

austin1 October 9, 2019

When trying to get `/2.0/repositories` from the Bitbucket Cloud REST API I receive the following response "This endpoint does not support token-based authentication" and a 403 status code.

I am using the ACE framework to sign the request, and the same pattern works with Jira Cloud under ACE.

I feel like I have followed the documentation here: https://developer.atlassian.com/cloud/bitbucket/authentication-for-apps/ and everything looks to be in order. 

Might the community have any suggestions?

Please let me know if there is more information that I can provide.

Thanks in advance.

2 answers

0 votes
kaanakdenz June 13, 2023
You should have the underlined line below in your "/installed" endpoint. Otherwise, it gives this error. Maybe this is the problem you experienced.    
lifecycleRouter.post(
        "/installed",
        addon.authenticateInstall(),
        async (req, _res, next) => {
            // Use api.bitbucket.org instead of the deprecated bitbucket.org/api
            req.body.baseUrl = req.body.baseApiUrl;
            next();
        }
    );
0 votes
masterj63 December 15, 2019

I have experienced something similar for posting commits' statuses. Finally this worked for me:

 

curl \
-v \
-X POST \
-H "Authorization: Bearer $tok" \
-d '{ "state": "INPROGRESS", "key": "key001", "url": "https://example.com/" }' \
"https://api.bitbucket.org/2.0/repositories/$team/$project/commit/$commit/statuses/build"

 

And the bearer token is what I got requesting oauth2/authorize and oauth2/access_token urls, see https://confluence.atlassian.com/bitbucket/oauth-on-bitbucket-cloud-238027431.html

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events