Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-75719

Changing base url is not reflected in OAuth configuration

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Low
    • None
    • 9.4.3, 9.8.0
    • Application Links
    • None

    Description

      Issue Summary

      Corresponding Confluence Issue: CONFSERVER-83364.

      Once the first application link is configured, the OAuth details are set. Any subsequent base url changes do not update the OAuth configuration. This leads to broken links on the "Authorized applications" page.

      N.B. The authorisation works fine. So far only the links have been identified as broken. 

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. Configure an application link between Jira and Confluence.
      2. Change base url in Jira or in Confluence.
      3. Delete the application link from both applications.
      4. Create a new application link between Jira and Confluence.
      5. Perform user authorisation between Jira and Confluence.
      6. Go to "Authorized applications" in user profile
        1. in Jira: secure/ViewProfile.jspa?selectedTab=com.atlassian.oauth.serviceprovider:jira-user-access-tokens
        2. in Confluence: users/revokeoauthtokens.action

      Expected Results

      "Authorized applications" page displays correct links.

      Actual Results

      "Authorized applications" page displays links pointing to the old base url of the application, whose base url has changed.

      Authorisation works correctly (e.g. Confluence displays Jira issue summaries). It's only the "Authorized applications" page that is broken.

      Workaround

       Always have a backup of your database before doing any changes to it. 

      If "Authorized applications" page in Confluence displays incorrect links to Jira, then Jira's configuration needs to be fixed, and vice versa.

       

      Workaround if Jira base url has changed and now links in Confluence are stale

      1. Find the stale OAuth configuration:

      SELECT description
      FROM oauthconsumer
      WHERE consumerservice = '__HOST_SERVICE__'

      2. You should get exactly 1 result. If you got 0 or more than 1 rows, abort the procedure and contact Atlassian Support.

      3. The result looks like this:

      Atlassian Jira at http://myOLDcompanyname.com/jira

      4. If this is indeed the old base url, update it by running:

      UPDATE oauthconsumer
      SET description = 'Atlassian Jira at http://myNEWcompanyname.com/jira'
      WHERE consumerservice = '__HOST_SERVICE__'

      5. Remove the old application link (from both Jira and Confluence).

      6. Restart Jira

      7. Create a new application link.

       

      Workaround if Confluence base url has changed and now links in Jira are stale

      1. Find the stale OAuth configuration:

      SELECT bandanavalue
      FROM bandana
      WHERE bandanakey = 'com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__';

      2. You should get exactly 1 result. If you got 0 or more than 1 rows, abort the procedure and contact Atlassian Support.

      3. The result looks like this:

      <properties>
        <property name="privateKey" value="..."/>
        <property name="name" value="..."/>
        <property name="key" value="..."/>
        <property name="description" value="Atlassian Confluence at http://myOLDcompanyname.com/confluence "/>
        <property name="signatureMethod" value="..."/>
        <property name="publicKey" value="..."/>
      </properties>

      Unfortunately, in Confluence this config is kept as an XML. This makes it more cumbersome to edit. The example above shows "..." for all the other values, but in your case you will get actual values. You must maintain those values as they are, updating only the description!

      4. If the description indeed holds the old base url, update it by running:

      UPDATE bandana 
      SET bandanavalue = '<properties>
        <property name="privateKey" value="..."/>
        <property name="name" value="..."/>
        <property name="key" value="..."/>
        <property name="description" value="Atlassian Confluence at http://myNEWcompanyname.com/confluence "/>
        <property name="signatureMethod" value="..."/>
        <property name="publicKey" value="..."/>
      </properties>'
      WHERE bandanakey = 'com.atlassian.oauth.consumer.ConsumerService:host.__HOST_SERVICE__';
       

      5. Remove the old application link (from both Jira and Confluence).

      6. Restart Confluence.

      7. Create a new application link.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kcichy Kamil Cichy
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: