Overview
We are trying to get API Authentication working for our Jira Cloud instance.
So far we have tried to call a simple GET endpoint to get the details of a ticket in both Salesforce Dev Console and in Restlet. Every time we try it, though, we get a 404 error. When trying to call the endpoint in Restlet if I'm logged into Jira in the browser at the time, it will work presumably because it uses my session credentials in the browser.
It seems very clearly to be an authorization issue of some kind, but we cannot figure out what is failing because we don't get much information in the response.
Details
Endpoint: "https://<OurSandboxUrl>.atlassian.net/rest/api/3/issue/<IssueKey>"
Header: "Authorization: BASIC <Base64EncodedUserNameAndAPIToken>"
Method: GET
Other Things We've Tried
Went through our Project permissions and added the user we're trying to authenticate with to have permissions for every possible action one can perform on an Issue/Ticket.
Hi Nick,
This took a bit of trial and error but I think i figured this out for you, and after some testing and comes down to the "BASIC" pre-flag in the auth header being case sensitive when your not logged in. I tried out the same call on my test site using a few different methods while I was logged out and logged in using the Restlet Client.
Where I was able to trigger the 404 when logged out but I could still trigger a 200 ok when logged in was if i removed the "Basic" pre prompt in the authorization header by overwriting it with the base64 encoded user:token string Or if I use all caps "BASIC" , EXE:
This Config failed with a 404 when logged out of the Jira cloud account using either capitalized "BASIC <Base64EncodedUserNameAndAPIToken>" or just the "<Base64EncodedUserNameAndAPIToken>" :
AND
But While Logged out the following Config Worked with a 200 ok status noting the "Basic" flag is present with capital "B" and lowercase "asic" in the Authorization header field before the encoded name:token variable:
BUT on the next screenshot I was logged into jira and similar to what you noted when logged into jira just using the base64 encoded name:token does work without the "Basic" pre flag or capitalized "BASIC":
AND
Regards,
Earl
That's exactly what it was! I really appreciate the time you put into this answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.