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 do I use a HTTP access token in a .netrc file

I created a HTTP access token in the Project settings and I would like to use the token in a .netrc file in a Ubuntu machine. Is this possible and how do I enter the information in to the .netrc file if it is possible?

1 answer

If you've created a token before January 2023:



echo "" > ~/.netrc-for-atlassian
chmod 600 ~/.netrc-for-atlassian
echo "machine <myhost>.atlassian.net login <my.name@email.address> password <64-bit token" >> ~/.netrc-for-atlassian

curl -n ~/.netrc-for-atlassian https://<myhost>.atlassian.net/rest/api/3/issue/<MY-ISSUE>

 


This has been working for me to great effect, however they've recently changed the api-token to a SIGNIFICANTLY longer string and every attempt to use the new api-token results in an error message
So curl or netrc is somehow broken with the new implementation, so I was looking to ask this exact question, but for newer tokens...

After reading man netrc I figured it out:
This method will work for 256-bit api tokens generated after January 2023

echo "" > ~/.netrc-for-atlassian
chmod 600 ~/.netrc-for-atlassian
echo "machine <myhost>.atlassian.net login <my.name@email.address> account <64-bit token" >> ~/.netrc-for-atlassian

curl -n ~/.netrc-for-atlassian https://<myhost>.atlassian.net/rest/api/3/issue/<MY-ISSUE>

 That's it, now it works

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events