Apologies in advance for mangled URLs, but “new users can only put 2 links in a post.”
I’m trying to generate a token for an OAuth2 app on Jira. I’ve set up a server at localhost that’s going to be the Client, and I’m trying to grant myself a token. However, I never get to the part where Jira confirms that the user wants to grant permissions to the app.
When my browser hits my server, I redirect it to this URL:
If I’m not logged in, I’m asked to log in first. Either way, I get a “Something went wrong” page with no further details.
I can tell from Chrome’s network tab that it’s hitting these routes, in order:
id.atlassian dot com/oidc/oauth/authorize
auth.atlassian dot com/login
auth.atlassian dot com/login/callback
api.atlassian dot com/oauth2/authorize/consent
… and that’s where it dies and gives me the error. I really don’t have anything to work with here, or I could probably resolve the issue myself. I’ve previously done OAuth2 apps on a few other sites (including Bitbucket), so I’m pretty confident that I’m handling all the basics. However, my prior experience with Bitbucket’s API suggests that there’s probably a critical, totally-undocumented piece of “Atlassian magic” that is assumed to be there, and breaks everything when it’s missing. This could be a particular header, cookie, what-have-you. I’m almost positive that my issue is something like that, but I don’t know what it might be.
I’ve gone through the bizarre process of registering the scopes at Log in with Atlassian account even though hypothetically I should be able to granularly request the scopes my app needs on a user-by-user basis, but that didn’t seem to help. Naturally, my app also has a callback URL registered that matches what I’m providing in the query string.
Does anyone have any suggestions?