Skip to content

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

bash
$ 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

The simplest approach is using GitHub's official CLI tool:

bash
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:

  1. Open Credential Manager (search for it in Start menu)
  2. Go to Windows Credentials
  3. Remove any credentials starting with git: or related to GitHub
  4. Run git pull or git push to trigger reauthentication

macOS:

  1. Open Keychain Access
  2. Search for "github"
  3. Delete relevant credentials
  4. Run git commands to reauthenticate

Linux:

bash
# 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:

bash
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:

  1. Visit GitHub Applications Settings
  2. Find and revoke authorization for "Git Credential Manager" or related applications
  3. Attempt your git operation again to trigger reauthentication

IDE-Specific Solutions

Visual Studio Code

  1. Sign out from GitHub in VSCode (click profile icon)
  2. Revoke "VS Code" authorization in GitHub Applications settings
  3. Sign back in through VSCode

Visual Studio 2022

  1. Click your profile icon → Account Settings
  2. 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:

bash
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:

  1. Verify your organization membership and SSO status
  2. Check that your personal access token has organization SSO authorization
  3. Ensure you're using the latest version of Git and credential helpers
  4. 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.