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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,464,884
Community Members
 
Community Events
176
Community Groups

How to authentice with app password via Python requests?

I want to use Sphinx linkcheck to check the documentation of Python projects for dead links. Some links point to stuff on Bitbucket and I need to provide credentials to see if those links are still alive. The sphinx documentation explains how to add credentials but I am struggling to get them to work. The following minimal example always yields a response telling me that Bitbucket does not support account passwords anymore, although I am using an app password.

import requests

response = requests.get(
    auth=("my_email", "my_app_pasword"),
)
What credentials do I have to pass to the requests library to access that link?

1 answer

0 votes
Patrik S Atlassian Team Jul 28, 2022

Hello Felipe,

Welcome to Atlassian Community!

I'm not really sure about the python syntax for that library, but looking at the example you shared, it seems like you are using the e-mail address as the username, and this is likely the reason why you are facing the authentication error.

To use basic authentication in calls to Bitbucket API you need to provide :

  • username : the bitbucket username of your account (not the e-mail address). You can check the username by going to your account's personal settings.
  • app password: a valid app password with the required permissions. The permissions necessary depend on the endpoint being called and are listed in the API documentation.

So in this case, you can try replacing the e-mail address with your bitbucket username and try executing the script again.

Hope that helps! Let me know if you have any questions.

Thank you, @Felipe Peter .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events