REST API from connect app auth

Hello,

I’ve created a simple connect app. On install I get the auth details (auth is set to jwt). On webhook of issue updated, I want to access the rest api of /rest/api/2/issue/{my_issue} .

When trying to access I get the “Issue does not exist or you do not have permission to see it”.

I’m sure that I have some authentication issue, because from my browser (connected to Jira) I see the JSON just fine, but I’m not sure where I went wrong.

Based on this documentation(I can’t put the whole link): /cloud/jira/platform/jira-rest-api-basic-authentication/

My question is:

[A]: where do I find the username that I need to do this curl?

curl -D-
-u fred@your-doman.atlassian.net:freds_api_token
-X GET
-H “Content-Type: application/json” \ …

[B} the API token is generated via this: https://bitbucket.org/atlassian/atlassian-jwt-js?_ga=2.37978083.1599257454.1534919912-53440487.1534055902 - but what is the secret? Is it the sharedSecret key from my JWT auth? or is it a different thing?

If you are writing a cloud app then don’t use basic auth, use this auth instead: https://developer.atlassian.com/cloud/jira/platform/authentication-for-apps/

That will require you to generate a signed JWT token. We have frameworks and tools that can help with that depending on the language you are using.

1 Like