It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Issue authentication with JIRA REST API

I followed this tutorial https://developer.atlassian.com/cloud/jira/service-desk/jira-rest-api-oauth-authentication/ to generate an access_token, it's working pretty well, i can perform my call with


java -jar OAuthTutorialClient-1.0.jar request https://jiratest.jira.net/rest/api/2/user?username=me\

but when i try with curl or postman

curl --request GET \
--url https://jiratest.jira.net/rest/api/2/user?username=me\
--header 'Authorization: Bearer MYACCESSTOKEN' \
--header 'Accept: application/json'

I always get "You are not authenticated. Authentication required to perform this operation."

1 answer

0 votes

Hello,

Thanks for including the rest call, and looking at the request it is failing because of the auth method in use being Bearer authentication in your script instead of Basic authentication with API Token similar to the exe curl command found HERE.

I believe all you need to do to correct this is to use basic authentication using the API Token to authenticate your calls, in your code try setting the header is set to:

"Authorization""Basic user:api_token"

 Let me know if this does the trick.

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

956 views 8 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you