How to fix-Support for password authentication was removed. Please use a personal access token instead?


GitHub has recently announced their migration to use token-based authentication which means you can no longer use your username and password for GtiHub authentication. You need to create personal access token to continue use of your GitHub Repository.

Here is my private GitHub repository which I was trying to clone and prompted with the error message -

Support for password authentication was removed. Please use a personal access token instead

Before fixing the issue lets try to understand how do you clone your Git Repo?

1git@github.com:rahulwagh/jhooq.git
2
3or 
4
5https://github.com/rahulwagh/jhooq.git 

This issue is very much dependent on the way you clone your repository.

1. git@github.com:rahulwagh/jhooq.git - If you are using SSH way of cloning the repository then you will not face issue related to personal access token. Because when you use SSH way of clonning then you should always create SSH Keys and copy public SSH key to GitHub SSH and GPG keys

2. https://github.com/rahulwagh/jhooq.git - If you are using HTTPS way of cloning the Git Repository then you will be prompted with username, password and after entering the username and password you will be thrown with error Support for password authentication was removed. Please use a personal access token instead




How to fix the personal access token for GitHub Repository

  1. Login to your GitHub account from the web browser.
  2. Goto -> Profile Pic -> Setting

personal access token settings

  1. After that you should look on the left navigation panel and there should be an option of Developer Settings

personal access token settings developer settings

  1. Aftr that it will redirect you to the new page where you will find an option Personal Access Token in the left navigation. You should click on it -

personal access token click on the option

  1. Then next on the right side of the screen you have an option to Generate New Token -

personal access token Generate new Token

  1. Enter the token name along with the scopes -

personal access token enter token name and scopes

  1. Finally Generate Token
  2. Now Copy the generated Token

personal access token copy generated token

  1. Go back to terminal and re-issue the Git Clone command and instead of password input the access token

supply personal access token instead of GitHub password

It should fix your issue of - "Support for password authentication was removed. Please use a personal access token instead"



Advantages of using Personal Access Token

  1. Strong - The Personal Access Token are randomly generated string which contains all possible combination of literal, number, upper case, lower case and special symbol. So it is really hard for brute force attack.
  2. Better Scoping - With personal access token you can control the access level at granular level.
  3. Multiple Personal Access Token - You can more then one personal access token so that you do not have to share password with anyone else.
  4. Revocable - You can easily revoke the access to repository by deleting the personal access token.

References

  1. GitHub Blog - Token authentication requirements for Git operations