How to re-authorize the OAuth Application 'Git Credential Manager'

16,795

Solution 1

My company just enabled SSO for my Github Org overnight so was getting the same error running git pull. I fixed this with the following steps.

  1. Open Credential Manager in Windows and delete the existing credential for github.com
  2. Re-initialise the cred manager in git bash: git config --global credential.helper manager-core
  3. Re-run git pull and follow the pop-up instructions to authenticate in a browser (which happened automatically for me with SSO).

After those steps git commands worked for me again.

Solution 2

I used the Github cli by running the following in the terminal

gh auth login

which then prompted me to re-authenticate, and I was able to.

If you do not have the CLI (Command Line Interface) currently installed, you can visit https://cli.github.com/ for more information. There is a download for Mac.

Solution 3

Delete git from "credential manager" window's application. Then pull on repo again. The sso authentication should automatically come up.

Solution 4

For VSCode users or any other IDE you need to re-authorize the app!

Go to your settings on GitHub -> Applications -> Authorized OAuth Apps, Search for "GitHub for VSCode", and choose "Revoke" from the "..." menu.

If you then sign out in VSCode and sign in again, you should be prompted to re-authorized

Share:
16,795
E235
Author by

E235

Updated on June 03, 2022

Comments

  • E235
    E235 about 2 years

    I am part of an organization that uses SSO in Github. I don't have problem to access the repository through the web, it redirects me to SSO login and that's all.

    The problem started when I logged-in first to my personal repository on GitHub through Git-Bash, I did some changes and then I wanted to do changes in a repository from my organization. When I run the below command, it wrote me that I need to re-authorize the OAuth Application, but I don't understand how:

    $ 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
    

    How can I re-authorize the login?

    I tried to re-open Git-Bash but it wrote me the same error.