jueves, 18 de marzo de 2021

Identificarse en GitHub con token de acceso en lugar de contraseña (Eclipse y STS)

If you're using Two Factor Authentication on GitHub, the "not authorized" error can be returned even if you are using the correct username and password. This can be resolved by generating a personal access token.

After generating the secure access token, we'll use this instead of a password. Make sure not to leave the page before you're done, because once you leave the page, you'll never see it again (thankfully it can be regenerated, but anything using the previously generated token will cease to authenticate).

This assumes that you've successfully installed EGit and that you've successfully cloned a repository.

  1. Go to your GitHub.com settings, and in the left hand pane click Personal access tokens.
  2. Click Generate new token. Select the scopes that you'd like this token to be able to use, and generate it.
  3. Copy the token. It should look something like this: 9731f5cf519e9abb53e6ba9f5134075438944888 (don't worry, this is invalid).
  4. Back in Eclipse (Juno, since that's OP's version), click Window > Show View > Other.... Under Git, select Git Repositories.
  5. A new pane appears, from which you can open (repository name) > Remotes > origin.
  6. Right click on a node and choose Change Credentials.... Enter your username for User, and your secure access token for the Password.

3 comentarios: