Oauth在github上克隆不工作(致命:认证失败) [英] Oauth Cloning on github not working (fatal: Authentication failed)

查看:763
本文介绍了Oauth在github上克隆不工作(致命:认证失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在github中测试我的应用程序。我有一个我的朋友授权我的应用程序访问私人和公共回购,并一切顺利。尽管如此,由于某种原因,我似乎无法使用Oauth令牌克隆他的回购协议,我在获得应用程序授权后回来了。

我使用此链接中列出的指令克隆: https://github.com/blog/1270-easier-builds-and-deployments-using-git-over-https-and- oauth



出站终端看起来像:

 <$ c $克隆到'repoName ... 
致命:身份验证失败

什么是实际这个错误的原因?我确保我的应用得到了正确的授权。它可能与我的电脑上的ssh密钥有关吗?这是我的理解,使用令牌我不需要ssh密钥克隆。

解决方案

这很奇怪。我只是试了一下,它为我工作。以下是我所做的:


  1. 使用 Authorizations API 。请注意,您必须指定该标记应该用于(至少) repo scope

  2. git使用repo的HTTP URL(不是git或ssh URL)
  3. 输入我作为用户名收到的令牌,并输入密码为空(<空>)。

如果我不得不猜测问题出在你的情况下,我会说这是两件事情之一(或两者):


  1. 您创建的令牌不包含克隆所必需的回购范围


  2. 您用于克隆的URL不是HTTP URL,而是GIT或SSH URL。确保您使用的是正在克隆的repo的HTTP URL。



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.

解决方案

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.

这篇关于Oauth在github上克隆不工作(致命:认证失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆