The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

JIRA REST API Personal Access Token gives an error for authentication (Powershell)

Blair Ensinger
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 7, 2022

Trying to move from Basic Auth (which works in our installation) to using a Personal Access Token (PAT) for a pair of Powershell scripts that do both a GET and a POST.  The GET used with the PAT returns a (400) Bad Request while the POST returns a (401) Unauthorized.  Both scripts work fine with Basic Auth.
I have seen where the 'Authentication" header duple (name/value pair) needs to look like this for the usage of the PAT ...
Name             Value
----                 -----
Authorization Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

... where the value is the word Bearer followed by a space and then the full Base64 encoded string displayed with the PAT is created.

Any I missing something in that this method is not working for me? Literally the only change in the code is the value changing from the word Basic followed by the encoded creds to the word Bearer followed by the PAT string.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Marakai
Contributor
February 7, 2022

You probably have solved this by now, but 'Authorization' must be follow by a colon, so:

curl -H 'Authorization: Bearer XXXXXXXXXXXXXXXXX' https://...
TAGS
AUG Leaders

Atlassian Community Events