Tempo API oauth2 access

Hello Folks,

i write a app with forge and try to POST some data to the tempo planner addon.
Therefore i’ve created an oauth2 access as described here(https://help.tempo.io/cloud/en/tempo-timesheets/developing-with-tempo/using-oauth-2-0-authentication.html)
As redirect i use:
https://id.atlassian.com/outboundAuth/finish
But it is still not working, as click through the authentication pop-up tab i get:
“We couldn’t connect your account. Try connecting your account again.”
Anyone any idea what could still be wrong ?
The manifest.yml:

modules:
  jira:projectPage:
    - key: tempo-multiuser-macro-hello-world-project-page
      function: main
      title: tempo multiuser macro
  function:
    - key: main
      handler: index.run
      providers:
        auth:
          - tempo
app:
  id: **

providers:
  auth:
    - key: tempo
      name: Tempo
      type: oauth2
      clientId: **
      remotes:
        - tempo-api
      bearerMethod: authorization-header
      actions:
        authorization:
          remote: jira-base
          path: /plugins/servlet/ac/io.tempo.jira/oauth-authorize/
        exchange:
          remote: tempo-api
          path: /oauth/token
        revokeToken:
          remote: tempo-api
          path: /oauth/revoke_token
        retrieveProfile:
          remote: jira-base
          path: /rest/api/3/myself
          resolvers:
            id: accountId
            displayName: emailAddress
remotes:
  - key: jira-base
    baseUrl: https://*.atlassian.net
  - key: tempo-api
    baseUrl: https://api.tempo.io

permissions:
  scopes:
    - read:issue-details:jira
    - read:application-role:jira
    - read:group:jira
    - read:user:jira
    - read:avatar:jira
  external:
    fetch:
      backend:
        - 'https://api.tempo.io'

and in my index.jsx i just try:

const tempo = api.asUser().withProvider('tempo', 'tempo-api');    
      if (!await tempo.hasCredentials()) {    
        await tempo.requestCredentials();    
      }    
      console.log("YOU PASSED !")

But i never reach the Log.
I am happy about every help i can get

Greets,
Hannes

4 Likes

Hello ,
I am facing the same issue
Any updates on this ?

I think thats because your jira-base remote is not correct for your Tempo installation.
In the Forge app code, there is no way to specify what the actual domain is to redirect to when calling requestCredentials(), so its literally using the * character for the sub domain, which wont work.

Does that line up with what you are experiencing?

To get this to work, I think you would need to make the baseUrl the domain of the Tempo instance you are targeting with your app.