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

API token not working (possible conflict with SAML?)

Hi,

I have followed the following documentation to the letter:

https://confluence.atlassian.com/cloud/api-tokens-938839638.html

I cannot get the token to work for viewing a request (e.g. a GET to "https://mybusiness.atlassian.net/rest/api/2/issue/ticketid"). I have completed the following steps to attempt to resolve:

  • I have created, revoked, and recreated several tokens on two different admin-level accounts (one attached to our SAML and one gmail account I created specifically for testing). For the account I created for testing, I gave it the required access to the project to make the REST request.
  • I have tested the REST API with both a Chrome plugin for testing APIs (Talend API Tester) and with the product I am attempting to make the REST calls with.
  • I have verified that the in-browser plugin makes the request as expected (and in fact ignores the "user" header) when I am logged in to either account in the same browser. I have attached a screenshot of this.
  • When not logged into Jira, and using exactly the credentials in the screenshot, I get a 404 response with the error message "Issue does not exist or you do not have permission to see it."

I have exhausted troubleshooting options and the only thing I can think of is that perhaps the fact that we have SAML active on our account is causing problems with the API tokens? (SAML has caused weird issues for us in other areas before.)

 

Screenshot of a successful query from a browser plugin while logged into the associated Jira account in a different tab in Chrome. This fails with a 404 if I make the same query after logging out in the other tab (i.e. without the associated login cookie active in the browser).

test with browser plugin while logged in.PNG

1 answer

1 accepted

0 votes
Answer accepted

Hi Brandon, 

Thanks for using Atlassian Community. 

Apitokens shouldn't be affected by your team's implementation of SAML. With or without SAML, apitokens are used to authorized API calls into Jira cloud via Basic Authentication.

To use that, you will need to add an authorization to your rest call. 

talented.png

The username will be your email address and the password is the apitoken string. Talented will convert that for you into the proper Authorization header which will be sent out with the rest call. 

I hope this helps. 

Regards,
Ramon

Looks like this was entirely a mistake on my part. For both the browser plugin and for the product I'm trying to integrate to Jira with, I was not properly generating credentials. This resolved my problem. Thank you!

Glad to help Brandon!

Suggest an answer

Log in or Sign up to answer
TAGS

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