Github Desktop Authentication Failed
Asked Answered
H

4

23

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.

Henotheism answered 8/10, 2018 at 18:11 Comment(2)
i would like to find the answer for this question, a coworker had github desktop working with VSTS (Azure DevOps) the funny thing is that it was an accident and he has no clue how to do it.Trottier
I had the same issue since DevOps promotes GitHub Desktop as a client. I was able to clone a repository in GitHub Desktop by creating a personal access token in DevOps and using that token as the password.Katleen
C
40

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.
Carpic answered 6/11, 2018 at 9:20 Comment(3)
in addition to step 6), i had to Regenerate the token as for some reason the token secret was not shown. also i entered the token into both the username/password fields in github desktopTab
To add here, if GH Desktiop doesn't prompt you for credentials, try cloning from the git command line first, then manually add the local repo and fetch. It should then ask for credentials, and you can use the above advice (username and PAT).Intellect
@wal, FYI, according to the info shown after creating the token, it is not stored in azure at all, so they cannot show it for you later. You need to save it in a safe place for future use or regenerate it as you say.Morale
H
1

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.

Heyduck answered 12/7, 2020 at 19:21 Comment(0)
C
0

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.

Contradistinguish answered 14/2, 2021 at 0:9 Comment(0)
H
0

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.

Hiett answered 23/11, 2021 at 11:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.