Password authentication was removed
Recently, I've been trying to clone a repository on Github. I ran into an issue where I couldn't clone the repository because password authentication is no longer supported.
remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.
remote: Please see https://github.blog/2020-12-15-token-authentication-requirements-for-git-operations/ for more information.
The error above has to do with a policy change in Github's security. The support for using regular username and password has been removed and instead been replaced with a personal access token. Click here for more information.
In this article, I'll be walking through the steps to take when faced with this error. Note that the steps below are for MacOS users.
Generating a personal access token
Follow these steps to generate a personal access token. Make sure to keep note of the generated personal access token as this will be used in the succeeding steps.
1. On the Github dashboard, click on Settings.
2. Click on Developer Settings
3. Click on Personal access tokens
4. Click on Generate new token
5. Enter password
6. Add a note for the token, configure expiry and the allowed permissions.
In this example, we are leaving all the persmissions is checked, and with no expiry
7. Click on Generate Token
8. Copy the token
Copy the token. Store it somewhere safe where only you can access it. You will need this personal token in the next step.
Using the Personal Token instead of password
If this is your first time ever to clone a respository in Github then follow these steps. If not, then proceed to the instructions on: Replacing the Credentials in Keychain access, below.
1. Re-clone the respository.
2. Paste the personal access token in the password prompt
3. Congratulations, you have successfully cloned the repository
Replacing the Credentials in Keychain access
If you've cloned a few repositories before in Github, it's likely that your credentials are already stored in the Keychain. Follow these steps to configure Keychain Access.
1. Open Keychain access.
2. On Keychain Access, search git
3. Click on github.com
4. Tick the checkbox show password
.
5. Enter system password, then click on Always allow
6. Paste the Token into the password field
Copy the token from the previous guide on generating a personal access token. Then paste it in the input as seen below:
7. Congratulations, you have successfully cloned the repository
Re-clone the repository
I hope this article will be of help to anyone who encounters a similar issue. 😄 👍