Hi, I'm a developer working on a Jira API integration for my organization that uses the cloud version of Jira. The eventual goal is to be able to occasionally create issues through the API but for now I'm just trying to get basic authentication working. (I really would prefer to avoid having to implement OAauth 2.0 if possible because the scope of necessary work there seems well beyond the basic need here)
I've been starting off by building some basic API calls in Postman, but I'm having a hard time getting Basic Auth working. Basically every call I've tried making has given me its version of an Auth error.
I've had this issue with other calls like creating issues and viewing issues, but to narrow the scope let's take this basic "myself" API call, and assume that the usual namespace for our org is jira.cloud.xxxx.com:
https://jira.cloud.xxxx.com/rest/api/3/myself
If I'm already logged into Jira in my browser, I can go to this link and it will work perfectly fine, giving me JSON about my current user. So I know this path works, and now I want to make the same call through postman.
I know that for Basic Auth, I need to have it send a combination of my email and my API token which I got from https://id.atlassian.com/manage-profile/security/api-tokens. I've tried going to the Authorization tab, picking Basic Auth, entering my email for the Username, and my API key for the password. When I make the GET API call to that same path, but from Postman with my Basic Auth, I get the following error message:
Client must be authenticated to access this resource.
I know I can also BASE64 encode the combination of my email + semicolon + apikey and put it after the word "Basic" as the value for an "Authorization" header, but it seems like doing it through the Postman UI does the exact same thing; I confirmed the value it's building is the same as if I built the header manually, and tried manually doing it a few times instead instead of doing it through the UI for good measure, no difference.
I tried both with regular and scoped API tokens (for the scoped one, I just gave it every granular permission for editing or inserting issues), and tried both the UI and manual encoding ways for sending the Basic Auth header, and had no difference.
I've also tried changing the 3 in the URL to a 2 just in case, no difference there either.
I thought well, I'm not an admin at my Org, maybe I need to be an Admin? So I was given admin permissions, recreated both my regular and scoped API tokens, no dice. I also had our Jira admin try generating an API token and tried with their email + token, no dice. I had another developer doing the same thing on their end, no dice.
I've tried searching for this error online, but the only things I can find are just people not sending the API Tokens properly. I tried following a step-by-step youtube tutorial for this stuff and they just breeze past this part with no issues in their environment. Either I'm missing something obvious, or there's something about my org that isn't playing nice with the API calls, but I really wouldn't know where to start in that case.
Any advice or ideas would be greatly appreciated!
Hello @Shea Prewett
If you provide the real URL to you Jira Cloud instance, not the fake domain 'jira.cloud.xxxx.com' I will test the connection and advise if the REST API is working as expected.
If you really are using Jira CLOUD not Jira DATA CENTER, then the Postman request you have shown should work.
PS. You've posted your question in the Bitbucket section of the community, not the Jira section.
PPS. If none of the developers at your company or even the Jira admin themselves can successfully make a Basic Auth request to any the REST API endpoints of your company's Jira instance, you may have bigger problems!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.