1

I'm switching from user/password authentication to token authentication with Eclipse EGit client and Github server.
Normally Eclipse EGit prompts for password where you can input your token safely.

My issue is that it tries to use the password that is already saved with user/password authentication.

As an ugly workaround, I've entered the token in user.password entry in the Git Configuration tab in the Eclipse preferences and it worked, but I'd like to know a safe way to achieve the same.

How do I input my token safely or force EGit to prompt for a password/token ?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
Sybuser
  • 735
  • 10
  • 27
  • You can try to remove the saved password, depending on what is used for saving it (keychain, wincred, etc). – dan1st Mar 25 '21 at 08:12
  • 1
    Or you might want to try [How to make Egit remember password and username?](https://stackoverflow.com/a/23191554) – dan1st Mar 25 '21 at 08:13
  • _"My issue is that it tries to use the password that is already saved with user/password authentication."_ <- In the preferences _General > Security > Secure Storage_ tab _Contents_ you can delete the already saved user/password. – howlger Mar 25 '21 at 11:23
  • By "token", do you mean ssh keys? The best strategy is simply to delete your local repository and reclone with ssh, not https. – David M. Karr Mar 25 '21 at 17:45
  • no, not the ssh keys, but the token that can be obtained on github website in settings -> developer settings -> personal access tokens – Sybuser Mar 25 '21 at 18:58

1 Answers1

0

My issue is that it tries to use the password that is already saved with user/password authentication

Try and clear first any password registered in your credential helper, as I describe here:

 git config --global credential.helper
 xxx
 printf "protocol=https\nhost=github.com" | git credential-xxx erase

For example, if xxx is "manager-core":

 printf "protocol=https\nhost=github.com" | git credential-manager-core erase

Then try again, and see if Eclipse prompts for the new credentials (where you can enter your PAT -- Personal Access Token -- as a password).

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250