backstage-plugins icon indicating copy to clipboard operation
backstage-plugins copied to clipboard

How should token look like?

Open Rades98 opened this issue 8 months ago • 4 comments

There doesn’t seem to be any discussion regarding this, so I’m opening it as an issue. Could someone confirm the correct format for the token? Should it be <email:PAT> encoded in Base64?

Here’s what I’ve tried so far:

  • Plain Personal Access Token (PAT)
  • Base64-encoded string in the format Basic <base64(email:PAT)>
  • email:PAT directly

None of these approaches worked, and all resulted in a 404 Not Found error. Additionally, it’s challenging to debug as there’s no log of the actual endpoint being called. Error:

{
  "error": {
    "name": "Error",
    "message": "Request failed with status 404 Not Found, {\n  \"error\": \"No Jira project found with key IKS\"\n}"
  },
  "response": {
    "statusCode": 404
  }
}

app-config.yaml

jiraDashboard:
  instances:
    - name: default
      token: Basic <base64Encoded>
      baseUrl: https://myOrg.atlassian.net/rest/api/3

annotation in catalog-info.yaml of my service:

apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
  name: iksapi
  description: IKS API
  annotations:
    ...
    jira.com/project-key: IKS
 specs:
   ...

Is there something I’m missing regarding the token format or the configuration?

I also tested calling the endpoint directly via Postman using Basic Auth, and it worked perfectly. Apologies for my confusion, and thanks in advance for your help!

Rades98 avatar Apr 08 '25 00:04 Rades98

If you are using the "non-cloud" version of Jira you can use the PAT directly like:

jiraDashboard:
  instances:
    - name: default
      token: Basic <PAT>
      baseUrl: https://myOrg.atlassian.net/rest/api/3

anicke avatar Apr 10 '25 06:04 anicke

If you are using the "non-cloud" version of Jira you can use the PAT directly like:

jiraDashboard:
  instances:
    - name: default
      token: Basic <PAT>
      baseUrl: https://myOrg.atlassian.net/rest/api/3

What about for the SaaS version of Jira? I'm also struggling to figure out the PAT format

dylanmtaylor avatar Apr 24 '25 00:04 dylanmtaylor

After some research I think are not able to use PATs with "Jira Cloud". The docs about PATs says that it's only for "server/data center" jira. Also this old response here says that this is not possible in "Jira Cloud".

anicke avatar Apr 24 '25 06:04 anicke

There was a regression in "@axis-backstage/plugin-jira-dashboard-backend" version 4.5.0. If this has not been resolved try again with the latest version (4.5.1).

anicke avatar May 07 '25 10:05 anicke

@Rades98, were you able to resolve this? We have Data Center and I am unable to retrieve issues for project:

error Could not find Jira project DST: Failed to get project info for project key DST with error: Request failed with status code 404: Not Found

I have tried

jiraDashboard:
  token: ${JIRA_TOKEN}
  baseUrl: ${JIRA_BASE_URL}

jiraDashboard:
  token: **Basic** ${JIRA_TOKEN}
  baseUrl: ${JIRA_BASE_URL}

jiraDashboard:
  token: **Bearer** ${JIRA_TOKEN}
  baseUrl: ${JIRA_BASE_URL}

Where my personal access token looks like: MDUzNjMzNDY2Mz************wW+dr4sEEMV7aFE

Cord-Thomas avatar Jun 10 '25 22:06 Cord-Thomas

No, I used the other plugin instead

Rades98 avatar Jun 11 '25 09:06 Rades98

Thanks everyone for the input on this issue 🙌 It’s been open for quite a while without recent activity, and we don’t currently have any plans to prioritize this work.

I’m going to close it for now to keep the issue tracker tidy. If someone is interested in picking it up in the future, feel free to reopen.

fridajac avatar Oct 20 '25 08:10 fridajac

There is new documentation for how to configure auth with jira cloud.

https://github.com/AxisCommunications/backstage-plugins/tree/main/plugins/jira-dashboard-backend#authentication-examples-and-trouble-shooting

anicke avatar Oct 20 '25 08:10 anicke