how to - github two factor authentication with eclipse
Asked Answered
S

7

30

I have to use the two factor authentication feature of github. That is fine. I am unable to comprehend how to use that with Eclipse. Whenever I commit my code or perform any activity, the only prompt I get from eclipse is to enter repository, userid and password. I have egit also installed but that does not help. Issue arrives in both Mac and Windows OS Does anyone out there know how to do this?

Thanks for your help in advance.

Solifluction answered 11/9, 2015 at 15:56 Comment(0)
M
30

Although I'm by no means an expert on this, it sounds like you should be using a Personal Access Token

Meredi answered 11/9, 2015 at 16:49 Comment(6)
Thanks David. You were right. I generated the Personal Access Token and then I copied the token and pasted it as my password in Eclipse. This worked for me.. thanks a bunch. Maybe you are an expert and do not know it yet? :)Solifluction
With Personal access token: "Error validating settings: Not Found"Abominate
Detailing exactly how to do this in the Eclipse GUI would be extremely helpfulBabel
For Eclipse use this link help.github.com/articles/…Rubie
"With Personal access token: "Error validating settings: Not Found" - Had this error too: You just have to remove the ".git" from the server url (eclipse.org/forums/index.php/t/846969)Uprise
Use Directly your generated that Personal Access Token as a password 100% works, EnjoyNeumark
B
13

What worked for me in Windows:

  1. Create Personal Access Token to authenticate to GitHub. Copy this token for step 3.
  2. In Eclipse open Window → Preferences → Team → Git → Configuration → Tab Repository Settings:

  3. Push your changes to github as usual. If you are asked to enter your github credentials enter your username and as password your above generated Personal Access Token.

Beecher answered 3/6, 2020 at 12:9 Comment(0)
C
10
  1. Login to your Github Profile
  2. Go to Setting
  3. Go to Developer Setting
  4. Click on Generate New Token
  5. Give a name to your Token, select all the Check Boxes.
  6. Generate the token.
  7. Your token will be created, copy the token, and paste it in eclipse in the password section while importing project from Git. Username will be your git Username. Select HTTPS mode while importing in Eclipse.
  8. Now you will be able to see your Branch. Pull appropriate one.

Thanks!

Conceptualize answered 17/6, 2020 at 7:31 Comment(2)
This works for me, but I did it before with Github CLI. Do you know if i should paste the token only in eclipse? Did I need to paste in eclipse login and did gh auth with-token...? Thanks!Nipping
Just so you know, this also works with Azure devops personal access tokensNerine
M
0

I follow the steps of @TheWoops. however, I initially tried to reuse a previously created Personal Access Token (2mo old). That did not work (same error messages). I then created a new PAT (with repo privileges) and able to get rid of the error when committing in Eclipse.

Milks answered 30/12, 2020 at 6:30 Comment(3)
I don't want to have to import an entire project from GitHub just to change my password sent to GitHub by Eclipse Git when I do a transaction. Does anyone know where to go in Eclipse Git to edit the remote credential used for GitHub?Graminivorous
@pbierre, solution found at eclipse.org forums, which I paraphrase here as: * Go to the Git perspective (from upper right icons in Eclipse) * In tree at left, open a repository / Remotes / origin, to see the hyperlinks below it * right-click one of the hyperlink items and choose "Change Credentials..."Milks
Here's how you use the new token: User: same account/user name you've been using PW: (token string) serves as new secure passwordGraminivorous
Z
0

Also, if you don't want to have to re-enter the PAT everytime you synch there is an option to "Store in Secure storage", check that. It's found under this menu: "Preferences | General | Security | Secure storage", in Eclispe 4.12.x

it also shows the "Storage location" of this file in the "contents" tab here.

Zr answered 28/10, 2021 at 23:24 Comment(0)
I
0

The weirdest thing is that even if 2FA is not enabled in my GitHub account, I had to generate and use the personnal access token to be able to push and commit from Eclipse. Generate personnal access token: https://github.com/settings/tokens Also, you need to have at least one branch in your repository, but you probably knew that.

Inhalant answered 5/6 at 10:37 Comment(0)
Z
-1

Also, if you are a member of an "Organization" and it requires SAML / OAuth for SSO, you need to take the additional step of "authorizing" the PAT for your org.

see here: https://docs.github.com/en/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on

Zr answered 28/10, 2021 at 23:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.