Uploaded image for project: 'Sourcetree For Mac'
  1. Sourcetree For Mac
  2. SRCTREE-7284

Accessing GitHub and Bitbucket via OAuth with same username fails

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Highest Highest
    • 2.5.2
    • 2.5
    • Bitbucket
    • None
    • Severity 1 - Critical

      I could reproduce this error/bug in SourceTree for a different setup (also still valid for 2.5 (104)):

      1. Take an GitHub account with username xyz
      2. Create an OAuth Authentication with username xyz and the same key 
      3. Repeat the step above for Bitbucket also with username xyz

      Result: the authentication will always fail for the second account added with the following error log:

      2017-04-16 07:26:53 +0000 (e) Error fetching password for SourceTree (OAuth) account with username xyz.
      Error Description - The specified item already exists in the keychain.
      2017-04-16 07:27:04 +0000 (e) [AUTH] Error: Cannot Authorize (Bitbucket)
      2017-04-16 07:27:04 +0000 (e) Fetching User owned repositories for Bitbucket cloud account failed. Error - Could not authorize request with the available token. Please re-authenticate.
      2017-04-16 07:27:09 +0000 () [AUTH] beginning authentication for Bitbucket account
      2017-04-16 07:27:12 +0000 (e) [AUTH] sign-in failed with error: The operation couldn’t be completed. (com.google.GTMOAuth2 error -1000.)
      

      It seems as the key for the account is somehow related to the username, instead of the username and a unique account id.

      Any comments on that? 

            [SRCTREE-7284] Accessing GitHub and Bitbucket via OAuth with same username fails

            Fix available in version 4.2.6. Kindly upgrade to latest version.

            Arati Mohanty added a comment - Fix available in version 4.2.6. Kindly upgrade to latest version.

            Hi everyone.

            We started analysing this issue and I have some difficulties with reproducing the same behaviour. I'm able to add two accounts with the same username using OAuth for GitHub and Bitbucket without any errors.

            Maybe you have any additional details, maybe someone could record video with steps to reproduce or provide more detailed steps. It will be very helpful to understand this issue better.

            d23cf41c6071, 6d4845928ac2  could you please check if this issue is still reproducible in latest Sourcetree version (https://www.sourcetreeapp.com/)?

            Thank you so much.

            Raman Sidarakin (Inactive) added a comment - Hi everyone. We started analysing this issue and I have some difficulties with reproducing the same behaviour. I'm able to add two accounts with the same username using OAuth for GitHub and Bitbucket without any errors. Maybe you have any additional details, maybe someone could record video with steps to reproduce or provide more detailed steps. It will be very helpful to understand this issue better. d23cf41c6071 , 6d4845928ac2  could you please check if this issue is still reproducible in latest Sourcetree version ( https://www.sourcetreeapp.com/ )? Thank you so much.

            I'm running into the same issue as Woo Ang on v4.1.6.

            docksteaderluke added a comment - I'm running into the same issue as Woo Ang on v4.1.6.

            Woo Ang added a comment -

            This is happening on 4.0.1. The minor difference seems to be that `com.google.GTMOAuth2 error` code is 1001 instead of 1000. Also, error pop up does not occur if logging is turned on.

            Woo Ang added a comment - This is happening on 4.0.1. The minor difference seems to be that `com.google.GTMOAuth2 error` code is 1001 instead of 1000. Also, error pop up does not occur if logging is turned on.

              43c951f935c6 Raman Sidarakin (Inactive)
              6d4845928ac2 Woo Ang
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: