git push or clone to GitHub over HTTPS refuses a password that is correct
remote: Support for password authentication was removed on August 13, 2021.Short answer
GitHub no longer accepts your account password for Git over HTTPS, so a correct password is still refused. When Git asks for a password, give it a personal access token, or let Git Credential Manager sign you in. If a token is refused too, look for an old saved credential, an expired or under-permissioned token, or missing SSO authorization.
Fix it fast
1Find out which cause you have
Look at which URL form the repository uses, and which credential helpers Git has configured. A saved credential is used before Git asks you anything, so the helper list shows where an old value may hide.
git remote -v git config --show-origin --get-all credential.helper2Match what you see, then jump to its fix
- 1
Git prompts for a username and password, you enter your usual login, and the removed-password message follows.Your GitHub account password was typed where a token belongsFix - 2
No prompt appears at all, yet the same error comes back every time.An old password or token is saved in the keychain or Credential ManagerFix - 3
The token worked earlier, or Git accepts it for reading but rejects the push.The token expired, was removed, or lacks permission for this repositoryFix - 4
Your own repositories work, but the organization's repositories are refused with the same token.The repository belongs to an organization that enforces SAML single sign-onFix
- 1
What does the error look like?
remote: Support for password authentication was removed on August 13, 2021.remote: Please use a personal access token instead.
Cause 1 of 4
Your GitHub account password was typed where a token belongs
1Check
GitHub's guidance is that when Git asks for your password you enter a personal access token instead. If the https:// remote prompts and you typed the login password, this is the reason.
git remote -v2Fix
Create a personal access token and paste it at the Password prompt (the username stays your GitHub username). To avoid handling tokens by hand, use Git Credential Manager, or sign in with the GitHub CLI and answer yes to authenticating Git.
# macOS: Git Credential Manager configures Git for you
brew install --cask git-credential-manager
# any system: sign in once with the GitHub CLI, choose HTTPS
gh auth login3Verify
A command that talks to the remote now succeeds, or asks for the token once and then stops asking.
git ls-remote originConfirmed by docs.github.com
Cause 2 of 4
An old password or token is saved in the keychain or Credential Manager
1Check
Git hands the saved value to GitHub before it prompts. GitHub warns that outdated credentials cached in Windows Credential Manager make Git fail to access GitHub, and macOS keeps the same kind of entry in Keychain Access under github.com.
git config --show-origin --get-all credential.helper2Fix
Make the store forget the entry for github.com, then let Git ask again. On Windows, open Credential Manager in the Control Panel under User Accounts, find the GitHub entry and delete it. On any system, git credential reject passes the host to each configured helper, which may erase a matching credential.
# any system with a credential helper
printf "protocol=https\nhost=github.com\n\n" | git credential reject
# macOS Keychain only
git credential-osxkeychain erase
# then type these two lines and press Return:
# host=github.com
# protocol=https3Verify
The next network command prompts for credentials again; enter the username and a valid token.
git ls-remote originConfirmed by docs.github.com
Cause 3 of 4
The token expired, was removed, or lacks permission for this repository
1Check
In GitHub open Settings, Developer settings, Personal access tokens. A token can carry an expiry date, and GitHub removes tokens that have not been used for a year. A fine-grained token needs the Contents permission at write level to push; a classic token needs the repo scope to use repositories from the command line.
git push --dry-run origin HEAD2Fix
Generate a new token with the access the repository needs and an expiry you can live with, then replace the saved credential using the previous cause so the old one is not sent again.
# after creating the new token, clear the old one and retry
printf "protocol=https\nhost=github.com\n\n" | git credential reject
git push origin HEAD3Verify
The dry run and the real push both complete without a password error.
git push --dry-run origin HEADConfirmed by docs.github.com
Cause 4 of 4
The repository belongs to an organization that enforces SAML single sign-on
1Check
GitHub says a token must be authorized before it can reach an organization that uses SAML single sign-on. Authorization is done per token and per organization, in the Configure SSO control next to the token under Developer settings.
git ls-remote https://github.com/ORGANIZATION/REPO.git2Fix
Open Settings, Developer settings, Personal access tokens, choose Configure SSO next to the token, and press Authorize beside the organization. If you do not see Configure SSO, sign in once through your identity provider first.
# no command line step: the authorization is a button in GitHub settings
# afterwards, repeat the failing command
git ls-remote https://github.com/ORGANIZATION/REPO.git3Verify
The organization's repository now lists its refs.
git ls-remote originConfirmed by docs.github.com
How do I stop it coming back?
- Use Git Credential Manager or the GitHub CLI so nobody pastes tokens by hand, and keep the helper in the global Git config.
- Give every token an expiry date and a reminder to renew it before it runs out.
- Grant the smallest permission that works: fine-grained tokens with Contents access on one repository beat a classic token with the repo scope.
- Switch a personal machine to an SSH key if you prefer never to handle tokens.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Related fixes
Security
git clone fails on a private GitHub repository
Key already in use
A private repository needs proof of who you are, and the proof depends on the URL.
4 causes, each with a fixSecurity
Entra ID token request fails: the request body must contain the parameter 'grant_type'
AADSTS900144: The request body must contain the following parameter: 'grant_type'.
The token endpoint did not find grant_type in the form body of your POST.
3 causes, each with a fixSecurity
Angular HttpClient does not add the X-XSRF-TOKEN header to a request
403 Forbidden on POST, PUT or DELETE while GET works
Angular copies the XSRF-TOKEN cookie into an X-XSRF-TOKEN header only for mutating requests to the same origin, and only when the cookie is readable by script.
5 causes, each with a fixSecurity
An [Authorize] endpoint rejects a request with a bearer token
Authorization Header sent: no Bearer token sent.
An [Authorize] endpoint without a policy name requires an authenticated user.
4 causes, each with a fixSecurity
ASP.NET Core API rejects an Angular user's token: the signature key was not found
401 Unauthorized
The API looked for the key named by the token's kid in the key set it downloaded from your Authority, and the key was not there.
4 causes, each with a fixSecurity
ASP.NET Core rejects the token before checking it: IDX12741, three segments expected
401 Unauthorized
IDX12741 means the string the API pulled out of the Authorization header is not shaped like a JWT: a signed token has three dot-separated parts and an encrypted one has five.
3 causes, each with a fix