Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Cannot setup SourceTree, stuck at OAuth authorization

Seadna Smallwood June 5, 2019

I started SourceTree today and was asked for my credentials. I entered them and it brought me to the OAuth authorization page but there is an error: 

Invalid redirect_uri

This integration is misconfigured. Contact the vendor for assistance.

So i did a full, clean install of the latest version of SourceTree and now I cannot complete the setup process as it is stuck at the OAuth authorization page with the same error as above. I need this working ASAP so any help is highly appreciated!

4 answers

1 accepted

2 votes
Answer accepted
Seadna Smallwood June 5, 2019

I found a way to get SSH method working: 

  1. Uninstall SourceTree and delete the Atlassian and Sourcetree folders from AppData\Local.
  2. Copy the Atlassian and Sourcetree folders from AppData\Local on a PC where SourceTree is installed and working fine to your PC.
  3. Run the SourceTree installer, it should just open up SourceTree.
  4. Click Tools -> Create or Import SSH Keys
  5. Click generate and follow the instructions to move mouse around.
  6. Enter a passphrase and save the public and private keys. Copy the text from the public key in the PuTTY key generator window.
  7. Open Bitbucket and open your account settings, go to SSH and paste in the public key that you copied from the PuTTY key generator window.
  8. You will need to change the URL to use the new SSH format. This guide shows how to do it: https://confluence.atlassian.com/bitbucket/change-the-remote-url-to-your-repository-794212774.html
  9. Restart sourcetree and try fetch, first try might give error but second try worked fine for me.

Hope this helps someone.

Seadna Smallwood June 5, 2019

Also, I recommend everybody to use SSH instead of HTTPS as a preventative measure.

Vadim Tofan June 6, 2019

@Seadna Smallwood Thanks, your solution worked for me. The last step didn't work well, after several Sourcetree restarts, the workaround was to close source tree, open an existent repository and edit the file ~\.hg\hgrc. Under [paths] replace the default OAuth link with the SSH link from bitbucket repository URL

Like Seadna Smallwood likes this
Seadna Smallwood June 6, 2019

@Vadim Tofan thanks for pointing that out! I did this also but forgot to put it in the list! I'll edit my post now.

Like Vadim Tofan likes this
1 vote
Mikael Sandberg
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2019

This is a known issue and has to do with OAuth, the Bitbucket team is aware of it and are actively working to resolve it. Check https://bitbucket.status.atlassian.com for more information.

Seadna Smallwood June 5, 2019

Awesome!

0 votes
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2019

Hi @Seadna Smallwood,

It looks like you might be running into this: 

https://jira.atlassian.com/browse/SRCTREEWIN-10965

While there isn't a posted solution for it yet, you might want to go vote, watch and comment on that issue.

Sorry I can't offer more help.

-James

Seadna Smallwood June 5, 2019

Thanks, I voted on it. Will comment now.

Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 5, 2019

@Seadna Smallwood - You might be right!  That or they are essentially the same thing but no one has investigated to see if they are the same root problem.

Seadna Smallwood June 5, 2019

Yes neither issue has been assigned yet. I linked them as i think they are the same.

Like Jimmy Seddon likes this
Seadna Smallwood June 5, 2019

I managed to get sourcetree running on my PC but still cannot fetch or pull. I have a laptop where it is running fine, I copied the Atlassian and Sourcetree folders from AppData\Local on my laptop to the same location on my PC. I then ran the installer again and SourceTree opened.

I cannot fetch however as it still asks for credentials and brings me to the Invalid redirect_uri error page.

Seadna Smallwood June 5, 2019

Sorry when I say 'running fine' i mean that I don't have the OAuth/redirect issue.

Seadna Smallwood June 5, 2019

So the issue is tied to the specific computer. I wonder is there a reg key that can be cleared or something. Or is there another location that I don't know about where is something that can be deleted.

Marek
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 22, 2020

Hi,

I have the same problem.

I installed sourcetree and registered bitbucket on one computer (with windows 10)

after that I tried install sourcetree on second computer (with windows 7) but it is no able to pass second step - registration,

when I click bitbucket web broswer opens new page with information "Authentication Successful"

but install stay in registration page.

I copied Atlasian and sourcetree directories from 1'st computer but stil the same...

0 votes
Vadim Tofan June 5, 2019

I have the same issue

Seadna Smallwood June 5, 2019

This is very frustrating that there is no solution for this!

Like Robert Ahlskog likes this
Vadim Tofan June 5, 2019

My workaround was to clone the repository into another folder. hope this helps you too. EDIT: this worked temporarely

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events