Jira Token Generation appears Broken

John Chesshir July 1, 2022

Several months ago (10/29/2021, to be exact) I used my Personal Jira account to generate an API Token.  That generated token still works to this day.

Today, though, we started trying to generate a token from a special company account in case I ever have to leave my company, and that token does not work.  I noticed that while the token I originally generated is 72 characters long, the newer one is only 24 characters long.

Furthermore, I tried going back to my own account's API Tokens screen.  There I can see the old token I generated, and when I use it to access the API from my program, I can see that it acknowledges I've used it within a short amount of time.  But then when I generate another new token, that new token (which is also only 24 characters long) from the same working account does not work anymore than the token from the new account.

So it appears that this is not an account problem, but a Jira Token generation problem.

Any ideas on what might be going on?

2 answers

1 accepted

0 votes
Answer accepted
John Chesshir July 8, 2022

I just figured it out. I had to go back to the documentation for using Jira Cloud API Keys to remember a step between generating the API key and setting it up for my application to use. The process requires combining the key with the username of the account that generated it and base64 encoding that combined string. The result, in my case, yielded a 72 char string that I was incorrectly assuming came directly from the application.

0 votes
Prince Nyeche
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 3, 2022

I think you can start by making a distinction of what both accounts can do on Jira (Personal vs company). Do they have similar privilege to control or administer Jira? API token once created will work. If the token generated from your company account doesn't work on the program you intended it for, then checking the privilege on such account is the first step. The next step is ensuring that you're using the personal token for such account (i.e company) if you're trying to access Jira REST API endpoint and not the admin token used for user management API as both types of token functions differently within Jira.

John Chesshir July 8, 2022

To be clear, when I talk about my "Personal Jira Account", I'm actually talking about a company account on the same domain as the "Special Company Account". The only difference is that the personal account will be deactivated if I ever leave our company, and so, presumably, the existing token we have given our program today would immediately stop working as well.

I already worked with my administrator reviewing the permissions of the Special Company Account, but we stopped searching after I went to the API screen from my own account and tried generating another Token, only to find that the exact same account that generated the working token is now generating tokens that do NOT work. So as I said before, this does not, at least not at this point, appear to be a permissions problem, but a token generation problem.

Of course, once the token generation problem is fixed and I can once again generate tokens from my personal account that will work, then we can turn back to evaluating permissions if tokens generated from the new company account still do not work. But first we've got to make sure Jira will produce working tokens from an account that I KNOW has the permissions needed to make our application work.

John Chesshir July 8, 2022

Concerning the specific token I'm trying to generate and what I'm trying to use it for. To generate the token from the account I'm logged into, I go to Settings > Atlassian account settings > Security > Create and manage API tokens. From there, I can see the specific token I generated months ago (72 characters), and it says it was last accessed 42 minutes ago, so I know it can be successfully used. The last token I created (which was only 24 characters) and tried to use says Never Accessed.

The API that we are using these tokens to hit has nothing to do with user management...only Jira Issue access and updating. It's at the point of calling "rest/api/2/issue/{issueId}", where issueId is the Issue's Key that we can see from Jira, that our program fails if it's using a freshly generated key, even from the same account that generated the key that works.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events