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 -
Before fixing the issue lets try to understand how do you clone your Git Repo?
firstname.lastname@example.org: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.
email@example.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
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
- Login to your GitHub account from the web browser.
- Goto -> Profile Pic -> Setting
- After that you should look on the left navigation panel and there should be an option of Developer Settings
- 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 -
- Then next on the right side of the screen you have an option to Generate New Token -
- Enter the token name along with the scopes -
- Finally Generate Token
- Now Copy the generated Token
- Go back to terminal and re-issue the Git Clone command and instead of password input the access token
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
- 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.
- Better Scoping - With personal access token you can control the access level at granular level.
- Multiple Personal Access Token - You can more then one personal access token so that you do not have to share password with anyone else.
- Revocable - You can easily revoke the access to repository by deleting the personal access token.
- GitHub Blog - Token authentication requirements for Git operations