The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Account Authorization with OAuth Failing, Unable to get secret

Tommy Yang
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!
June 21, 2023

Ran into an issue with sourcetree/git where I couldn't pull/checkout any branches. I assumed it was some type of authorization error with my account, so I removed my credentials to try and readd them. But every time I try to authorize with OAuth or Basic, Sourcetree will hang for a long time and then I get these error messages. I'm pretty sure I have my password right, and I am signed in to bitbucket on my web browser Google Chrome.


"Unable to get secret"
"Error reading JObject from JsonReader. Path ", line 0, position 0."

image.png

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Vanessa Mouriz
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
August 22, 2026

Hi Tommy,

This "Unable to get secret" / JsonReader error is a known Sourcetree issue with the OAuth token exchange for Bitbucket — Sourcetree's embedded auth flow sometimes fails to parse the JSON response it gets back, often triggered by antivirus/firewall SSL inspection, a corporate proxy, or just a corrupted local token cache.

A few things to try, in order:

  1. Switch to an App Password instead of OAuth. This is the most reliable fix. In Bitbucket, go to Personal settings → App passwords → create one with Repository read/write scopes. Then in Sourcetree, edit the hosting account, set Authentication to "Basic" instead of OAuth, and use your Bitbucket username + the app password (not your account password).
  2. Clear cached credentials. On Windows, open Credential Manager and remove any entries related to Bitbucket/Sourcetree. On Mac, check Keychain Access for the same. Then re-add the account in Sourcetree from scratch.
  3. Check for SSL interception. If you're on a corporate network or have antivirus with "HTTPS scanning" enabled, that can corrupt the OAuth response mid-flight. Temporarily disabling it to test will confirm if that's the cause.

App passwords tend to be more stable long-term anyway since Bitbucket is moving away from OAuth-based app integrations in several flows.

kind regards!

DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events