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 \
--header 'Authorization: Bearer MYACCESSTOKEN' \
--header 'Accept: application/json'
I always get "You are not authenticated. Authentication required to perform this operation."
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.
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