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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.