How do I POST back to connect app?

Hello,

As the title says I would like to POST back data to my connect app which is on a private server.

I need it for the following AUTH flow that I would use:

  1. User installs APP on Jira
  2. A connect button appears in an issue as a glance
  3. User clicks > redirect to a site where he is asked to authenticate
  4. When AUTH process completed he will receive an API key which he can use for a fixed amount of time to perform requests in the site
    The POST back should happen on this step.

I’ve tried so far to get the JWT token from the current context of the connect app in the issue: AP.context.getToken() and use the token to access the app but I get Unauthorized: JWT claim did not contain the query string hash (qsh) claim meaning the token cannot be used for outside app access.

I know that the steps above sound like an OAuth flow, but as I explained the steps we currently don’t support OAuth authorizations in a standard way.

Please keep in mind that I’m new to Jira Cloud.
Any ideas related to this topic would be appreciated!

Hey @RobertTutsek Welcome to the Atlassian Developer Community.

What you’re describing sounds very much like you should be using the 3LO auth. To be clear this is a separate type of app than a Connect app.

Here’s the docs https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps/

Hello,

So from my understanding, I can use the sample code you provided on the client side to generate the token from my connect app data (oauthClientId, sharedSecret) and use that JWT token to send data to my Connect app? for example that authorization has succeeded on our side.

My underlying goal is to authorize a user on our side and store an API key on connect app that identifies that the user has access to our system (he can make API calls). As I said in my first post I need to send back the API key if the user successfully authenticates on our side.

Thank you!