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,465,032
Community Members
 
Community Events
176
Community Groups

wget on repository file returning 401

Edited

this not work

 

wget --user=BitbucketUsername --password=AppPassword --auth-no-challenge https://bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml

 

please solve error

 

--2022-12-14 13:54:57-- https://bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml
Resolving bitbucket.org (bitbucket.org)... 104.192.141.1, 2406:da00:ff00::22c5:2ef4, 2406:da00:ff00::22c0:3470, ...
Connecting to bitbucket.org (bitbucket.org)|104.192.141.1|:443... connected.
HTTP request sent, awaiting response... 401 Unauthorized

Username/Password Authentication Failed.

3 answers

already my project need to use wget and not curl and your BitbucketUsername:AppPassword is not working I already try them and neither on the api nor on the raw file

 

wget --user=BitbucketUsername --password=AppPassword --auth-no-challenge https://bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml

 

not work return 404

 

wget https://BitbucketUsername:AppPassword@bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml

 

not work return 404

 

wget --user=BitbucketUsername --password=AppPassword --auth-no-challenge https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

not work

 

return this error

 

{"type":"error","error":{"message":"You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}

 

 

wget https://BitbucketUsername:AppPassword@api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

not work

 

return this error

 

{"type":"error","error":{"message":"You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}

 

 

the only one that works is with the token

and still only one works

 

wget --user=x-token-auth --password=privatetoken --auth-no-challenge https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

not work

 

return this error

 

{"type":"error","error":{"message":"You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}

 

wget https://x-token-auth:privatetoken@api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

not work

 

return this error

 

{"type":"error","error":{"message":"You may not have access to this repository or it no longer exists in this workspace. If you think this repository exists and you have access, make sure you are authenticated."}}

 

 

wget --header "Authorization: Bearer privatetoken" https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

 

only this work

 

which can be disturbing because some config

cannot pass custom header

nor make a post request

it would therefore be necessary to ensure that one of those is 100% functional without which there is no other verification therefore no verification of user-agent or others

 

 

https://BitbucketUsername:AppPassword@bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml

 

or

 

https://BitbucketUsername:AppPassword@api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

or

 

https://x-token-auth:privatetoken@bitbucket.org/workspace-id/repo-slug/raw/master/folderA/folderB/folderC/file.xml

 

or

 

https://x-token-auth:privatetoken@api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/maste/folderA/folderB/folderC/file.xml

 

except none of those works

0 votes

Hi @andykimpe and welcome to the community.

It is not possible to download repository source code files this way. You can use our API instead:

Below is an example call with curl:

curl -u BitbucketUsername:AppPassword https://api.bitbucket.org/2.0/repositories/workspace-id/repo-slug/src/master/myFile.xml -o myFile.xml

Please feel free to let me know if this works for you.

Just a heads up I removed the file URL from your post to comply with our privacy policy. I also moved your post to a separate question; it's best to create a new question if you need assistance, as a post can become difficult to follow if we troubleshoot multiple users' different issues.

Kind regards,
Theodora

0 votes

Welcome to the Atlassian Community!

Bitbucket username/password authentication was deprecated over 6 months ago.  See https://community.atlassian.com/t5/Bitbucket-articles/Announcement-Bitbucket-Cloud-account-password-usage-for-Git-over/ba-p/1948231

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events