Oauth Cloning on github not working (fatal: Authentication failed)

两盒软妹~` 提交于 2019-12-11 13:16:10

问题


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:

  1. create new token using Authorizations API. Note that you have to specify that the token should be for (at least) the repo scope.

  2. git clone a private repo using the HTTP URL of the repo (not the git or ssh URL)

  3. 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):

  1. the token you created does not contain the repo scope which is necessary for cloning

  2. the 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!