mattermost-plugin-jira: Not able to connect to a Jira cloud instance

After running the slash command /jira instance connect <instanceURL> or in case of a single instance /jira connect. I am getting the error

could not get user info for client, err: No response returned: Get "https://<url>.atlassian.net/rest/api/2/myself": oauth2: cannot fetch token: 400 Bad Request
Response: {"error":"invalid_grant","error_description":"Invalid aud: https://auth.atlassian.io"}

Steps to reproduce:-

  1. Install the instance by running the command /jira instance install cloud <url> .
  2. Upload the app on the Jira cloud instance.
  3. Run /jira connect and click on the URL.

mattermost server version - 6.6

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 5
  • Comments: 18 (12 by maintainers)

Most upvoted comments

we have exactly the same problem which is preventing us from migrating our gitlab/omnibus team edition to the already paid standalone kubernetes operator premium edition. Is there any ETA for this issue? By the way our team edition is working fine and reinstalling works fine but on the seperate premium edition with exactly the same Jira Cloud Instance we are facing this issue, which makes me believe it is not an jira issue. Maybe related to the Reverse Proxy Configuration or something like that?

Oh its a plugin update! That makes it so much more awesome! 😄

Thanks for the info!

Hi @Jawknee-cache, currently there is no workaround. Once https://github.com/mattermost/mattermost-plugin-jira/pull/949 is merged and released, then this should be resolved. We apologize for this inconvenience.

@Kshitij-Katiyar Maybe this is another way around this while still using Atlassian Connect. Is there any other info you were able to uncover about the issue?

@Kshitij-Katiyar Feel free to give the PR a review to get a better understanding of what is implemented there

@Kshitij-Katiyar I was mainly resolving merge conflicts. I’m not able to own the PR going forward though because I will be OOO for the next few weeks.

@Kshitij-Katiyar With some testing I’ve confirmed that using OAuth 2 via https://github.com/mattermost/mattermost-plugin-jira/pull/928 sidesteps the issue. Are you able to pick this PR up? This issue is particularly urgent, as it seems no Jira Cloud instances can be connected to at the moment.

I encountered the exact same problem, plugin version 3.2.5.

Mattermost Version: 7.10.0
Database Schema Version: 105
Database: postgres

I tried downgrading manually to 3.2.3 but it’s not working either.

It’s also possible this is a regression on Jira’s side, or possibly a deprecation we were unaware of for an API we are using. A quick search for this error isn’t yielding much information, but maybe there is more information to be found.

Thanks @Kshitij-Katiyar 👍

I’m not sure exactly what the problem is here. If we can’t figure it out with a little debugging, and it reproduces on every setup, we may need to go down the path of deprecating the Atlassian Connect method of authentication.

We’ve been wanting to deprecate the Atlassian Connect method for a while, which is currently how the user authentication with Jira Cloud works in the plugin. The alternative is to use Jira’s OAuth2.0 offering, which we have implemented in a PR https://github.com/mattermost/mattermost-plugin-jira/pull/928 that was closed due to change in priorities.

The author of that PR is no longer working on the project, so the PR will need to be picked up again and driven to be merged. The PR has been dev approved, and has some remaining concerns from QA here https://github.com/mattermost/mattermost-plugin-jira/pull/928#issuecomment-1538466665.

@Kshitij-Katiyar What are your thoughts on getting the OAuth2 PR merged and shipped, to resolve the ticket you’ve created here? cc @hanzei @DHaussermann

@mickmister This is the error I am getting here. Yes, the tab navigates to Jira’s site. Please find the video below for more understanding

Screenshot from 2023-05-30 20-48-37

jira-error.webm

exact same Problem here - was working smooth before Plugin Update:

Steps to reproduce:- Install the instance by running the command /jira instance install cloud <url> . Upload the app on the Jira cloud instance. Run /jira connect and click on the URL. mattermost server version - Version: 7.7.1 DB-schema-Version: 100 Jira-Plugin-Version: 3.2.5