-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot connect mattermost to jira using Jira plugin due to bad expiration timestamp #600
Comments
Hi @AndreiLopatenco I have not seen this issue. But, I'd like to try and reproduce it. If I understand correctly, you can only connect your user when using a browser that's already authenticated in Jira? Can you please provide some additional information?
|
hi @DHaussermann, Thanks for coming back to me.
The latest at the time of writing, i.e. 2.4.0
Jira Cloud
I tried both, via the Mattermost macOS desktop app version 4.5.2 (4.5.2.6864) and via browser. Note that it's the same browser I'm already logged into Jira but it still throws that error.
Not sure I got this question, could you rephrase it please? |
Thanks @AndreiLopatenco A few other question just for some more context...
|
hi @DHaussermann, Thanks for the clarifications, It's all clear now.
Yes, there's only one instance of the Mattermost server and one Jira instance
Unfortunately I've got just one user to test with
Yes, also tried
When I copy and paste the
I, however, still cannot connect, I am just able to get the above JSON, which, supposedly, doesn't work when accessed when I type Please let me know if that makes sense at all? |
@AndreiLopatenco Yes I think I understand a bit better. So, pasting the URL is not a work-around and your not able to connect your user at all. In that case one more thing you can try as a troubleshooting step is to reinstall the app on the Jira side as well if you have not already. I would do the following:
I'm sure most of this is already working or you would not have seen the connect option appear. But, hopefully steps 4. and 6. might turn up some more information. |
hi @DHaussermann, Thanks for the steps, however, I faced the same issue.
Step 5. executed with no issues. I still get the same error message when I type Since it says: Response: {"error":"invalid_grant","error_description":"Expiration timestamp too far in the future [was 135 seconds from now; please set Many thanks |
Tracing the code a bit, it seems this issuedAt := time.Now()
expiresAt := issuedAt.Add(180 * time.Second)
return &AtlassianClaims{
qsh,
jwt.StandardClaims{
IssuedAt: issuedAt.Unix(),
ExpiresAt: expiresAt.Unix(),
Issuer: c.Key,
},
} which is using another library jwt-go, that implements the structure that Atlassian describes here. type StandardClaims struct {
Audience string `json:"aud,omitempty"`
ExpiresAt int64 `json:"exp,omitempty"` // Here is the `exp` value
Id string `json:"jti,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`
Issuer string `json:"iss,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`
Subject string `json:"sub,omitempty"`
} The I can create a build of this plugin with that library patched to set the expiration to only 60 seconds. @AndreiLopatenco Is this something you'd be willing to test out? |
Hi @mickmister, Absolutely, just let me know when you have the build and I'll give it a try. Cheers! |
You can find a version with this change here: The relevant commits for this change, made on top of the plugin's @AndreiLopatenco Please let me know if you have any questions. Thanks for filing this issue, and for your cooperation! |
hi @mickmister, I have just tried using the latest build but I get the same issue. I have as well removed the installed plugin and did a fresh install via System Console but that didn't change anything I'm afraid. Is there anything else I could try here? |
@AndreiLopatenco Thanks for trying the build. It seems something may have changed on Jira Cloud's side with the authentication process. I'm looking into it now. |
Hi @AndreiLopatenco, are you able to reproduce this on a Mattermost instance running in a different environment? |
Any news on this, latest mattermost version still running into this issue :/ |
Hi @BlueSky-fur, thanks for letting us know this is still occurring. This issue should be resolved once #949 and #953 are released. No other updates on this currently |
@BlueSky-fur The above two PRs are merged and release, can you please confirm if you are still facing the issue or now, so that we can work on this accordingly? |
The installation of the plugin went successfully, however, I couldn't connect the mattermost account with jira account and I get the same issue all the time in a new window, where I'm logging into my Jira Cloud account:
Whenever I try the same URL by pasting into the browser, where I'm already logged in - it works well.
Please let me know if this is something I could fix on my own as I couldn't find a way to change the timestamp expiration.
Many thanks.
The text was updated successfully, but these errors were encountered: