-
Type:
Bug
-
Resolution: Fixed
-
Priority:
High
-
Affects Version/s: 7.0.11, 7.6.2, 8.0.1
-
Component/s: Application Links, Ecosystem - Connect JIRA Integration
-
7
-
8
-
Severity 2 - Major
-
38
Summary
Unable to reset OAuth settings for a DVCS account (github or bitbucket) when there are multiple DVCS accounts present
Environment
JIRA 7.x - JIRA 8.0.1 linked to multiple github and / or bitbucket accounts
Steps to Reproduce
- Create at least two OAuth applications in GitHub and / or Bitbucket. Take a note of the Client IDs and Security Keys for the created accounts
- Link JIRA to these applications via JIRA -> DVCS Accounts -> Link Bitbucket Cloud or GitHub account
- On the latest configured account in JIRA -> DVCS Accounts select tripple dots menu to the right of the account and select "Reset OAuth Settings", "Configure OAuth for account [accountname]" should come up - take a note of the current key and authorizing account
Expected Results
JIRA should display the correct "Current Key" value and "Authorizing account" and should allow to reset the account token
Actual Results
JIRA shows "Current Key" and "Authorizing account" value of the very first DVCS account configured which is incorrect (and it actually shows the same key and authorizing account across all other DVCS accounts in JIRA) As a result, unable to reset the OAuth settings as per the ticket summary.
When trying to Edit the settings (i.e. click EDIT on the Configure OAuth for account [accountname]" and proceeding to change the Key and Secret, and then hitting "Regenerate Access Token" - JIRA comes up with "OAuth key must not be blank" value even though the values are filled in
Notes
This happens only when multiple DVCS accounts are present in JIRA. When there's only one DVCS account configured, there's no issue
Workaround I
Delete the DVCS account that requires token renewal in JIRA and re-add it
Workaround II
- Identify your organization ID by hitting https://<base-url>/rest/bitbucket/1.0/repositories. You're looking for an organizationId value that matches the organization you want, which you can tell from the repositoryUrl value.
- Using Postman or curl, make a x-www-form-urlencoded POST to https://<base-url>/rest/bitbucket/1.0/org/<org-id>/oauth, passing the parameters
organizationId: <org-id>
key: <key>
secret: <secret> - If you want, you can confirm this worked by running SELECT * FROM AO_E8B6CC_ORGANIZATION_MAPPING in your DB and confirming that the values are in place (directly modifying this table is likely another route to solving this problem, but would likely require a restart and the next step to take effect).
- In your browser, hit https://<base-url>/secure/admin/RegenerateGithubEnterpriseOauthToken.jspa?organization=<org-id>, click Retry if prompted, then authorize the app on the GHE side.