问题
I am trying to test my app in github. I had a friend of mine authorize my app to access private and public repos and that all went fine. Despite this for some reason i can't seem to clone his repos using the Oauth Token i got back after he authorized with my app.
I cloned by using the instruction outlined in this link: https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and-oauth
The out come in terminal looks like:
Cloning into 'repoName...
fatal: Authentication failed
What is the actual cause of this error? I made sure my app was properly authorized. Could it have something to do with my ssh key on my computer? It was my understanding that using the token i would not need an ssh key to clone.
回答1:
That's strange. I just tried it and it worked for me. Here's what I did:
create new token using Authorizations API. Note that you have to specify that the token should be for (at least) the
repo
scope.git clone a private repo using the HTTP URL of the repo (not the git or ssh URL)
enter the token I received as the username and nothing (blank) as the password.
If I had to guess what the problem is in your scenarion, I would say it is one of these two things (or both):
the token you created does not contain the
repo
scope which is necessary for cloningthe URL you are using for cloning is not an HTTP URL, rather a GIT or SSH URL. Make sure you are using the HTTP URL of the repo you are cloning.
来源:https://stackoverflow.com/questions/15817709/oauth-cloning-on-github-not-working-fatal-authentication-failed