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

Authentication failed on Gitlab account adding

Hi,

 

   It seems to be impossible to add an existing GitLab account to SourceTree. When requested for authentication, though using correct username and fresh password, it continuously fails.

 

   Any suggestions that doesn't involve using a different repo provider?

7 answers

1 accepted

2 votes
Answer accepted
minnsey Atlassian Team Feb 21, 2019

Hi

You need to use a Personal Access Token https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html

We are improving the text on those dialogs to reflect this

Thanks for the suggestion. I should have elaborated the steps that lead to the issue.

In first instance, an attempt to text copy the personal token from Gitlab to Sourcetree proved impossible to accomplished. The text box for the personal token was present but completely inactive, making impossible to write and/or copy text.

The next step was to click on the Refresh Personal Token. This popped up a login window, which lead to the authentication issue.

Any options to introduce the Personal Token?

Thanks

Sorry, to clarify.

yes you need to click on the Refresh Personal Access token and then in that popup dialog enter your username and use the PAT as the password there.

Is this what you were doing and you still got the error?

Like # people like this

I proceeded as you suggested and that worked smoothly. Thank you very much!

 

I would suggest changing the UI and messaging a little. The whole thing is a bit misleading.

minnsey Atlassian Team Feb 26, 2019

Yes, some small improvements are already in progress

Hi, i've same problem using SourceTree 3.1.2 (216) but i no have a Refresh Personal Access token button !

How can i do ?

sourcetree-account-gitlab.png

Like # people like this

Since this question has been marked as Solved but the problem still exists for later Sourcetree versions, or for Sourcetree on Mac, or both together, I have opened a new question to address the remaining problem here.

Solution found: enter your personal access token as the password. Do not enter your GitLab password.

It's not clear to me which scopes are required for the personal access token in this case. I used "api" and "read_user" and they worked for me.

Like # people like this

Entering the token helps with the Account add for Sourcetree; however, when you push/pull changes, you get the following prompt and the token doesn't clear this password requirement:

 

Screen Shot 2020-08-19 at 9.30.17 AM.png

Screen Shot 2020-08-19 at 9.31.19 AM.png

1. Go to this link https://gitlab.com/profile/personal_access_tokens and create a personal access token

2. From source tree, Tools/Option.  Click Authentication tab, add account, choose gitlab and enter username as name of personal access token, password is Personal Access Token. 

=> Done

WTF!! this workarround works!

We put password as access token and our username and works fine.

I'm using 3.1.2 on a Mac and running into this same issue, except I don't see Tools / Options anywhere within Sourcetree and no option to Refresh PAT. Please help!

Hi joseposes22, I'm using 3.1.2 on my windows 10. I've tried your method, but it didn't work. 

For me it didn't work too.

Unable to find Refresh Personal Access token button on SourceTree 3.1.2 (225).
How Can we do?
Team , Please look into this asap.
Thanks


Screenshot 2019-07-12 at 8.22.26 PM.png

not working at all. i even removed all auhentication fields, yet when i try to push my code to gitlab repo i get basic auth failed, you need access token.

 

i did setup access token, my access token has FULL access.

 

in old 1.9 source tree same token works flawless, but in new fugly 3.x nothing works. removing all account restarting git, doesn't work. adding manually account to setting (which creates 2 entries, one for basic auth, and one account) doesn't work. yes PAT refresh token says SUCCESS but PUSH to repository always fails.

 

guys can you finally fix this? 

 

it's huge pain, and whenever i forget to decline upgrade to 3.x shit. i need to revert back to 1.9 to get working git client.

ok small update (i found this, when i was solving another problem - after update terminal didn't work - switching to "system" git instead of embeded git solved not only terminal problem, but also "authentication" issue)

so authentication doesn't work with embeded git, but does work with system git.

Hi, 

 

I have system git version selected...

image.png

I use GitLabEE, and when I refresh Personal Access Token and I put my GitLab username y the PAT generated token from GitLab, it does not work.

image.png

image.png

image.png

So, it is impossible to connect. Please, could anyone recommend me another tool, NOT Sourcetree? Thanks!!

Like Thuy_Doan likes this

I created a new token, using my username like name of token and when I tried to login in sourcetree, in my password I type thisasdadadsad.PNG

And my login was successful

After more than a year, it's still an issue that forced me to google and waste 30min of my time reading discussion threads! 

I'm now able to add the account with the token hack; however, on git push/pull I get a password request where neither my Gitlab password or token works.

It turns out the prompt is asking for the `ssh` password, see Gitlab support thread here:

https://forum.gitlab.com/t/unable-to-authenticate-gitlab-in-sourcetree/41623/4

If anyone else can't resolve this, of course follow @Quy Ho's instructions, but also make sure you're choosing the correct GitLab Hosting Service. Mine was GitLab CE and I spent some unnecessary time trying to log in with GitLab.

0 votes

Hi all, 

Just wanted to update this thread to let you know there is now a native automation trigger for GitLab with Jira Cloud. We are running a webinar soon to walk through how it works and show some use cases in how to automate from Gitlab to Jira. Feel free to register here: https://www.atlassian.com/webinars/software/automate-across-gitlab-and-jira

Cheers!

Suggest an answer

Log in or Sign up to answer
TAGS
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...

4,910 views 0 12
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