It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Cannot setup SourceTree, stuck at OAuth authorization Edited

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

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.

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

@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

@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 Jun 05, 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.

I have the same issue

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

Like Robert Ahlskog likes this

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

0 votes
Jimmy Seddon Community Leader Jun 05, 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

Thanks, I voted on it. Will comment now.

Jimmy Seddon Community Leader Jun 05, 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.

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

Like Jimmy Seddon likes this

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.

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

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.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

960 views 0 9
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you