Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How use List Pull Requests API with App Passwords (and Basic Auth)?

I'm trying to use List Pull Request API with App Password.

https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get

I'm using Basic Auth. If I use my account password, then the API response is following.

Bitbucket Cloud recently stopped supporting account passwords for API authentication.
See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
App passwords are recommended for most use cases and can be created in your Personal settings:
https://bitbucket.org/account/settings/app-passwords/
For more details on API authentication methods see our documentation:
https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication

So I created App Password and selected all permissions. And then, I changed Basic Auth to use App Passwords. The username is "Name of the App Password," and the password is  "Password of the App Password." 

Now the response of the same List Pull Request API is

401 Unauthorized

Is there anything else that I have to do to make it work? Like I said that I gave all permissions to the app password. And according to Bitbucket API, I can use app passwords with Basic Auth.

https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication

Note that Basic Auth is available only with username and app password as credentials

 

1 answer

1 accepted

0 votes
Answer accepted
Neil
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Mar 14, 2022

Hi @harri_rajala_koivu_solutions - to use app passwords in basic auth, the username you'd use is your Bitbucket username (visit https://bitbucket.org/account/settings/ to see/change your username). As I understood it, you were trying to use the label that you attributed to the app password when you created it. 

Interesting. Day by day, i feel it is much efficient to go through the support channel instead of spending hours decoding the Atlassian Documentation.

I wonder why such a simple piece of knowledge is hidden from the users and buried deep in the support channels. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events