Linking external auth API (google-apis) in Jira Project page app

I am currently building an app on Jira using external google APIs. But the error is that

Error: Bad provider or missing config for provider google

My manifest.yml is as follow.

modules:
  jira:projectPage:
    - key: jira-google-oauth-app-hello-world-project-page
      resource: main
      resolver:
        function: resolver
      render: native
      title: Jira-Google-OAuth-App
  function:
    - key: resolver
      handler: index.handler
      providers:
        auth:
          - google
resources:
  - key: main
    path: src/frontend/index.jsx
app:
  runtime:
    name: nodejs22.x
  id: ari:cloud:ecosystem::app/baea60a1-8bae-4e3a-be12-92782e04f504
providers:
  auth:
    - key: google
      name: Google
      scopes:
        - "profile"
        - "https://www.googleapis.com/auth/userinfo.email"
      type: oauth2
      clientId: MY-CLIENT-ID
      remotes:
        - google-apis
      bearerMethod: authorization-header
      actions:
        authorization:
          remote: google-account
          path: /o/oauth2/v2/auth
        exchange:
          remote: google-oauth
          path: /token
        refreshToken:
          remote: google-oauth
          path: /token
        revokeToken:
          remote: google-oauth
          path: /revoke
        retrieveProfile:
          remote: google-apis
          path: /userinfo/v2/me
          resolvers:
            id: id
            displayName: email
            avatarUrl: picture
remotes:
  - key: google-apis
    baseUrl: https://www.googleapis.com
  - key: google-account
    baseUrl: https://accounts.google.com
  - key: google-oauth
    baseUrl: https://oauth2.googleapis.com
permissions:
  external:
    fetch:
      backend:
        - https://www.googleapis.com
        - https://accounts.google.com
        - https://oauth2.googleapis.com

Even if I added proper providers in manifest.yml, it also shows that

"My app is not eligible to run on atlassian. "

Here is the repo of my project - https://github.com/Latimerhtet/Jira-Google-Auth

Hi @KaungHtet, I had a look at your manifest and the logs from our end and it seems that the Google provider is not available at runtime.
The manifest seems to be correct, so I would suggest checking the following:

  • The errors seem to be occurring when tunnelling, have you deployed your changes and made sure that you are running on the latest version of your app? Note that running the tunnel does not automatically deploy changes to the manifest.
  • Did you run forge providers configure for your Google provider? reference and an example.
  • Make sure that you are running on the latest version of @forge/api .

As for this message:

"My app is not eligible to run on atlassian. "

It’s not an error and isn’t the cause of the other issue. You are seeing it because your app makes an external egress calls to Google, it isn’t eligible for Runs on Atlassian.

1 Like

Hello BoZhang,
I am really thankful for your dedicated contribution to my issue. As you mentioned, I forgot to upgrade installation to my Jira account. I really appreciate your advice.
I wanna ask you that

"Does it mean that my app can’t run on my Jira if I got a message of “Your app is not eligible for run on Atlassian”?

Secondly When I install and make “forge tunnel” again and I make authentication to google-apis for configuration, it is giving me this error.

could not retrieve access token from the provider 401. Error response : { "error": "invalid_client", "error_description": "Unauthorized" }

Thank you so much for your active reply.

Hi @KaungHtet, that error occurs when we run into issues exchanging for the access token using the OAuth client configuration provided.
I had a look at the logs though, it seems like there is a valid Google OAuth token for your invocation, are you still running into the issue?

The message related to Runs on Atlassian, this doesn’t mean that your app cannot run in Jira, it’s there to tell the customer that the app doesn’t have any data egress outside of Atlassian, in other words, the app runs entirely on the Atlassian platform.

Hello BoZhang,
Thank you so much for your contribution to my issue. I have solved it luckily. The error is that I am pasting my client secret from Google API twice in the terminal. That’s why it is giving me error. As for Run on Atlassian, I understand fully now. Thanks for guiding me throughout my error.
Regrets,
Kaung Htet San.