Luke
Luke

Reputation: 1673

Eclipse Git (Egit) not accepting remote username and password

Why doesn't Egit accept username and password when fetching from remote?

These are the steps I follow:

  1. In Git Repositories view I expand Project -> Remotes -> origin
  2. Right click on origin -> fetch
  3. Login mask appears; I insert User and Password
  4. Repeat step 3 other two times
  5. An error message appears: https://companyname.visualstudio.com/.../projectname: not authorized

Credentials are correct and I am authorized because I use them daily with any kind of git interface: TortoiseGit, SmartGit, Git Bash, ...

I did research but didn't find this problem. Also similar questions don't address this problem.


Update: I used a workaround following this guide. I created an access token from the Visual Studio Team Services account and I'm using that as password.

My git installation is using Git Credential Manager (GitHub page, Microsoft guide to GCM) to store credentials, in fact when I ran for the first time git through the interfaces I mentioned above and tried to connect to the Team Services Git repository the Microsoft Account login window popped up and that was it. Also I can tell it from runnig the command git config --list and getting credential.helper=manager.

Eclipse has the Team Explorer Everywhere plug-in installed, so it should interact with Git Credential Manager and accept the Microsoft Account credentials, but it doesn't. So this is still an open issue.

Upvotes: 14

Views: 35004

Answers (5)

jayaprakash tr
jayaprakash tr

Reputation: 1

Use personal access token for https. Fine graned tokens are preferred.

Refer. https://cse132.engineering.wustl.edu/files/githubEclipseAuth/githubEclipseAuth.html

Upvotes: 0

Devanathan M
Devanathan M

Reputation: 11

I had the same issue, not able to update the username in eclipse pop up while pushing to Git. Irrespective of username, I have provided the generated git credentials password and it worked.

Upvotes: 0

Atul Arnav Sharma
Atul Arnav Sharma

Reputation: 373

I was facing the same issue

From git side settings-->developer settings-->Personal access tokens-->generate new token-->copy that token and use that token as password.

Upvotes: 27

Spiff
Spiff

Reputation: 4104

The way to fix this is to go to

Window->Preferences->Team->Git

And then change the HTTP client from Apache HTTP to Java Built-in HTTP

Upvotes: 5

MrSimpleMind
MrSimpleMind

Reputation: 8627

The Git clients you mention uses "native" git, and the credentials are provided transparently during the communication with the server.

Eclipse git client (jgit+egit) is full-java based, and unfortunately you can't use native git in Eclipse.

Either your Git server has user+password locally (not so enterprise-ish!) or you could use Kerberos tickets in Eclipse git; but before you run Eclipse you should do a kinit to create a ticket with your user logon, that is accessible from java process. (Normally the ticket is in your user home directory)

Example using kinit:

enter image description here

I m not so sure about the TFS plugin, but maybe in your case it is worth to install it and see if it helps you instead of the embedded egit, see https://msdn.microsoft.com/en-us/library/hh301122(v=vs.120).aspx

Upvotes: 3

Related Questions