Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

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

SourceTree keeps creating new Personal Access Tokens on my GitHub account!

I use GitHub with 2FA.  In previous versions of SourceTree, I could go into my GitHub Account and create a Personal Access Token and use that as my password, and all was good in the world.  Now, with version 2.0.20.1, SourceTree will not accept the Personal Access Token that I generate myself, and it seems to keep generating new ones automatically on my GitHub account and keeps repeatedly asking for me to re-login with 2FA.  Each time I do, it seems, it creates another new Personal Access Token.

For example, every time I switch from my wired connection to wireless, SourceTree pops up a GitHub login, where I enter my usual username and password then the 2FA code sent to my phone.  It seems like every time it does this, it creates a brand new Personal Access Token in my GitHub account - totally defeating the purpose!

Under Tools --> Options --> Authentication, SourceTree has created its own "github.com" entry for me with Username: Personal Access Token.  I tried to delete that one and set up my own, using Basic Authentication, with my usual github username and a Personal Access Token I manually generate myself as the password, and it will not connect with those credentials.  It seems the only way it will connect to github is through the Account it creates itself after the github login popup screen - the one that keeps creating new Personal Access Tokens each time.

Very frustrating and particularly annoying since I pay for each of those texts to send the 2FA code to my phone.

2 answers

1 accepted

1 vote
Answer accepted
Mike Corsaro Atlassian Team Jun 14, 2017

Hello! I'd highly recommend that you use the OAuth feature for GitHub accounts -- it's much easier to setup and works much better. When adding a new account, just select the OAuth option, and hit the "Refresh OAuth Token" button.

Thanks! OAuth solved the problem for me but it required a restart of the app after authorising. It also did not help that after redirecting back to localhost there was an error in the browser - I thought the OAuth flow failed.

Mike Corsaro Atlassian Team Jun 16, 2017

Glad I could help! Sometimes that happens -- it's currently a known bug.

I'm having a similar issue (SourceTree 3.0.12):

I created a personal access token in github (account requires MFA)

when I add an account (Tools -> Options -> Authentication) if I choose OAuth, it logs me into my github account and uses my user name in the "Username" field and it is not possible to change the username. I can't change it and there's no place to put the personal access token.

what am I missing?

Try entering the personal access token as your password 

I tried that. Tried Basic auth with my username I get:

Failed to check login for user [xxx].

user/emails was not found.

I tried with both: username and username@gmail.com

 

Untitled.png

 

I had the same problem, "Failed to check login for user" ... "user/emails was not found" but I found what was causing it!

When you create your Personal Access Token (PAT) on GitHub, you need to have the "user:email" permission selected, otherwise SourceTree will fail to read that and complain that the login failed (while it was just SourceTree not being able to obtain the user email).

 

2021-01-04_12-47-30.png

I posted this here because there seems to be no post on the internet that explains how to fix it, I guess either people figure it out eventually or they just give full permissions to the token (while only repo:*, workflow, and user:* are needed for almost all use cases on SourceTree)

The problem seems to have resolved itself when I updated to version 2.1.2.5

Suggest an answer

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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

3,250 views 4 5
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