Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

OAuth authentication results in a blank screen and git clones fail

Ryan Taylor
Contributor
November 14, 2023

One time is an annoyance. Twice is a coincidence. 3 or more times is a pattern.

We have several folks who cannot authenticate to Bitbucket.org using SourceTree to obtain a refresh token for git clone/push/pull operations. They experience this whether this is a first time setup or the nth.

They *are* able to log in to the Bitbucket.org website fine. Here are the steps to reproduce.

  1. Open SourceTree > Tools > Options > Authentication tab
  2. Add/Edit an account, specifying
    1. Hosting Service: Bitbucket
    2. Host Url: https://bitbucket.org/ (uneditable)
    3. Preferred Protocol: HTTPS
    4. Authentication: OAuth
    5. Username: blank (uneditable)
  3. Click Refresh OAuth Token
  4. A Browser (often Chrome) opens and they are are required to login if they haven't
  5. Ultimately, they should get a http://localhost:34106/?code=<some-code>&state=authenticated page

For many in our org, that authentication page remains blank.  There are no error messages and it appears SourceTree authenticated until they try to perform a git clone/pull/push at which point they receive the following error:

Error: remote: Invalid credentials

fatal: Authentication failed for 'https://bitbucket.org/<workspace>/<repo>.git

We have tried clearing cache, windows credentials, updating SourceTree and Git to no avail. The only solution for these folks is to use SSH. But SSH support in SourceTree is terrible.

What is the resolution to this issue?

1 answer

0 votes
Martin Runge
Community Champion
June 19, 2026

Hi @Ryan Taylor

I would resolve this by navigating to Tools > Options > Authentication to delete the cached Bitbucket account, then re-add it using a Bitbucket App Password instead of OAuth to entirely bypass the browser's broken local loopback redirection.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events