Cannot login with Bictbucket, after granting rights it redirects to localhost
Asked by Joan Comas:

I just downloaded and installed the app and the second step is Registration.

1. I click on Bitbucket.
2. In my Chrome main window, a new tab is opened with url "[https://bitbucket.org/site/oauth2/authorize...:""](https://bitbucket.org/site/oauth2/authoriz)And the text "Confirm access to your account".
3. I click on Grant access.
4. The page gets redirected to "[http://localhost:34106/?state=authenticated\&code=XXXX](http://localhost:34106/?state=authenticated&code=)"
5. The app does not allow me to go to next step "Install tools".

Any help would be appreciated.

Software:

Windows 10 1709 Build 16299.1146

Chrome Version 75.0.3770.142 (Official Build) (64-bit)

Thanks,

Joan


Answers:
author: Ana Retamal
body: Hi Joan, welcome!

I can see you're having trouble getting started with Sourcetree. If you're on Windows, Sourcetree should be using Internet Explorer for the authentication steps. Can you confirm IE is upgraded to the latest version?

Hi Madhavi, welcome to the Community!

The reason why SourceTree points to localhost in the URL is because it runs a temporary webserver in order to support OAuth callbacks to give the auth_token.

The issue seems to be that you're not able to go to the next step. What happens exactly? Could you send us a screenshot?

Something else you can do to help with the troubleshooting as much as possible is to check the Sourcetree logs and tell us what you find, they can be found at

```
C:\Users\<username>\AppData\Local\Atlassian\SourceTree\sourcetree.log
```

Let us know!

Ana

comments: author: Joan Comas
body: Hi Ana,

Thanks for the reply.

My **Internet Explorer** version is ++11.1146.16299.0++ update 11.0.125.

I also have **Microsoft Edge** ++41.16299.1004.0++.

And **Chrome** Version ++76.0.3809.100++ (Official Build) (64-bit).

Chrome is my **default** browser. Should I change it to IE?

This is the log I receive:

ERROR \[2019-08-27 13:48:42,641\] \[1\] \[SourceTree.Analytics.Submission.Gas.GasAnalyticsSubmissionService\] \[Log\] - Hi There! ERROR \[2019-08-27 13:48:50,812\] \[1\] \[SourceTree.Exceptions.RemoteHostException\] \[Log\] - Unable to receive callback from OAuth service providerERROR \[2019-08-27 13:48:50,866\] \[1\] \[SourceTree.Exceptions.RemoteHostException\] \[Log\] - Unable to get user secretERROR \[2019-08-27 13:48:50,867\] \[1\] \[SourceTree.Exceptions.RemoteHostException\] \[Log\] - Unable to get secretERROR \[2019-08-27 13:49:05,316\] \[13\] \[Sourcetree.Installer.Squirrel.Utils.UpdateHelper\] \[Log\] - Unable to check for Updates.System.Exception: Remote release File is empty or corrupted at Squirrel.UpdateManager.CheckForUpdateImpl.\<CheckForUpdate\>d__2.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Squirrel.UpdateManager.\<CheckForUpdate\>d__7.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sourcetree.Installer.Squirrel.Utils.UpdateHelper.\<CheckForUpdate\>d__16.MoveNext()--- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Sourcetree.Installer.Squirrel.Utils.UpdateHelper.\<HasAvailableUpdates\>d__17.MoveNext()

This screenshot is when i click the button "Bitbucket" in Sourcetree:  
![sourcetree-before.png](https://community.atlassian.com/t5/image/serverpage/image-id/64433iCF9AD7630E8A44AF/image-size/large?v=v2&px=999 "sourcetree-before.png")  

This screenshot is when I click the button "Grant access" in the Chrome window:

![sourcetree-after.png](https://community.atlassian.com/t5/image/serverpage/image-id/64434i1B10C1D08A6EED5E/image-size/large?v=v2&px=999 "sourcetree-after.png")


Tags: windows