Creating organization under DVCS account using rest API does not honour oAuth and hence does not work

XMLWordPrintable

    • Type: Bug
    • Resolution: Not a bug
    • Priority: Low
    • None
    • Affects Version/s: 8.17.0
    • Component/s: DVCS Accounts
    • 8.17
    • 4
    • Severity 2 - Major
    • 5

      Issue Summary

      When a user tries to create/add organization to already linked DVCS account that requires oAuth authentication(for example: GitLab), using rest API, it creates/adds the org, but fails to list the repos within it and sync it further.

      Steps to Reproduce

      • With your existing Jira install, link DVCS to a self managed GitLab or other version control.
      • Make a rest call to add/create org within that DVCS account, using the API as below:
        POST /rest/bitbucket/1.0/organization {hostUrl:"http://gitlab.com", dvcsType:"GitLab", displayName:"MyOrg", autolinkNewRepos:"true" , smartcommitsOnNewRepos:"true"}
        

        This is a sudo code, change this to a curl.

      Expected Results

      Org should be added to the DVCS account in Jira and all its repos should be listed within it and synced for the first time.

      Actual Results

      Org gets added, but it does not list any repo and no further sync works.

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Note: This happens because the payload to create Organization also expects the credential type info within the body. But, internally, it is not handling the credentials even if we pass along the tokenID within payload. This way it adds the org with UnauthenticatedCredential type where as GitLab that needs oAuth2.0 works with ThreeLeggedOAuthReferenceCredential type.

            Assignee:
            Unassigned
            Reporter:
            Vikas Pandey (Inactive)
            Votes:
            9 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: