bdi cesec
bdi cesec

Reputation: 233

Github Desktop Authentication Failed

Using: Windows 10, Github Desktop, Git 2.19.1.windows.1(64bit), VisualStudio VSTS

Background: Managed to add the repository I had in my machine, but I can't do anything with it. I have access to the remote repository, I used gittortoise before, and I could commit just fine.

Procedure: Trying to use Github desktop to fetch, pull, or commit changes to remote.

Error: Authentication Failed (We were unable to authenticate with repository. Please enter your username and password to try again.)

Attempt: Tried to input the username and password I used to login visual studio vsts, it keeps giving me the same error.

Objective: Fetch, pull, commit from github desktop to remote repository.

Upvotes: 23

Views: 31037

Answers (4)

t3chb0t
t3chb0t

Reputation: 18734

There is one more caveat to be aware of. It's important to use the correct address of the repository. It needs to have the following format:

https://<organization>@dev.azure.com/<organization>/<project_name>/_git/<repository_name>

as pointed on Authenticating to Azure DevOps with GitHub Desktop.

Note that the link specifies <username> inplace of the <organization> however this did not work for me and also the properties of a repository use the organization there.

Upvotes: 0

pxl9588
pxl9588

Reputation: 42

After searching for many answers which did not work I stumbled on a https://github.com/desktop/desktop/issues/7454

This was the solution that worked for me.

Some users have reported modifying the command processor's AutoRun setting (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\Autorun) has caused these authentication issues.

After removing my Autorun, I no longer had issues.

Upvotes: 0

Rawnak
Rawnak

Reputation: 41

I was also facing the same error today. I cross-checked and found that I have already added remote origin by

git remote add origin "url"

So basically removing remote origin or remote destination solved my issue.

git remote rm origin
git remote rm destination

Post that I tried pushing with github desktop, and it worked.

Upvotes: 1

Ted Strome
Ted Strome

Reputation: 466

Actually, the guy above, @bhoeschen, is spot on.

Instead entering your VSTS / Azure DevOPS username and password, rather create a Personal Access Token (PAT), and use that for the password.

https://learn.microsoft.com/en-au/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate

Condensed instructions from that page:

  1. Sign in to either your Azure DevOps organization
  2. From your home page, open your profile. Go to your security details.
  3. Create a personal access token.
  4. Name your token. Select a lifespan for your token.
  5. Select the scopes that this token will authorize for your specific tasks.
  6. When you're done, make sure to copy the token. You'll use this token as your password.

Upvotes: 40

Related Questions