Re-authorizing Git Credential Manager for GitHub SSO
When working with GitHub repositories that require SAML Single Sign-On (SSO), you may encounter authentication errors that require re-authorizing the Git Credential Manager. This commonly happens when:
- Your organization recently enabled or enforced SAML SSO
- You previously authenticated with personal credentials and now need organizational access
- Your authentication token has expired or been revoked
Common Error Message
$ git push --delete origin v0.1.3
remote: The '<my_company>' organization has enabled or enforced SAML SSO. To access
remote: this repository, you must re-authorize the OAuth Application 'Git Credential Manager'.
fatal: unable to access 'https://github.com/<my_company>/myproj.git/': The requested URL returned error: 403
Recommended Solutions
1. Use GitHub CLI (Recommended)
The simplest approach is using GitHub's official CLI tool:
gh auth login
This command will guide you through the authentication process, including SSO authorization if needed.
TIP
If you don't have GitHub CLI installed, download it from cli.github.com
2. Clear Credentials and Reauthenticate
Windows:
- Open Credential Manager (search for it in Start menu)
- Go to Windows Credentials
- Remove any credentials starting with
git:
or related to GitHub - Run
git pull
orgit push
to trigger reauthentication
macOS:
- Open Keychain Access
- Search for "github"
- Delete relevant credentials
- Run git commands to reauthenticate
Linux:
# View stored credentials
git credential-store --file ~/git.store
# Remove problematic credentials manually
3. Use Git Credential Manager Command
For Windows users with Git Credential Manager installed:
git credential-manager github login
This command specifically triggers GitHub authentication through the credential manager.
4. Revoke and Reauthorize OAuth Applications
If the above methods don't work, you may need to revoke and reauthorize applications:
- Visit GitHub Applications Settings
- Find and revoke authorization for "Git Credential Manager" or related applications
- Attempt your git operation again to trigger reauthentication
IDE-Specific Solutions
Visual Studio Code
- Sign out from GitHub in VSCode (click profile icon)
- Revoke "VS Code" authorization in GitHub Applications settings
- Sign back in through VSCode
Visual Studio 2022
- Click your profile icon → Account Settings
- Remove and re-add your GitHub credentials
Alternative: Switch to SSH Authentication
If you continue to experience issues with HTTPS authentication, consider switching to SSH:
git remote set-url origin git@github.com:organization/repository.git
WARNING
Ensure you have SSH keys properly configured in your GitHub account before using this method.
Prevention and Best Practices
- Regularly update Git Credential Manager to the latest version
- Use GitHub CLI for authentication management when possible
- For organizations with SSO, ensure your personal access tokens have proper organization authorization
Troubleshooting Steps
If you're still experiencing issues:
- Verify your organization membership and SSO status
- Check that your personal access token has organization SSO authorization
- Ensure you're using the latest version of Git and credential helpers
- Try restarting your terminal/IDE after making changes
By following these methods, you should be able to resolve the Git Credential Manager authorization issue and successfully access your organization's SSO-protected repositories.