Hey guys,
This is a hard one because it's actually a Github issue, but I thought I should warn you guys.
I have a private repo that I'm using as a pod with the :git option in my Podfile. The problem is that I have to be authenticated to be able to clone the private repo. So when I try pod install the terminal prompts asking my Github username and password but it fails to authenticate. I realised it could be an issue with Two Factor Authentication that I'm currently using so I disabled it in my account and the problem stopped.
I had re-enabled the TFA after everything went fine and tried cloning the repo directly from Github with the https URL and the issue persisted. So yes, it's an annoying Github issue and be aware that it may cause some headaches.
Thanks for the heads-up and this way people can at least search the tickets and find the cause for it.
Do you have a solution suggestion for how we can fix this without you having to disable it? If so, please re-open the ticket. For now I鈥檓 closing it, because it鈥檚 not really a CocoaPods issue.
I didn't found any workaround other than disabling TFA yet.
Also, I've just realised there's no way to report an issue to the git/git repo... so I guess we'll have to wait or find another way to report what's going on.
Have you tried using private SSH keys by specifying your repository address with the git:// scheme instead of https://?
It worked! Thank you! I didn't thought of setting the ssh URL instead of the https.
Cool! I discovered that when pod repo adding a private spec repository.
@fjcaetano can you show an example of the spec you ended up using? I'm having a similar issue when putting together my own podspec. Essentially I have private specs on github, and have 2FA enabled on my account, naturally I'm running into the "please use HTTPS, oh wait you can't clone a private repo over HTTPS with 2FA enabled" would love to see an example.
@brianmichel I changed the https git link to ssh
Instead of
pod 'Foo', :git => 'https://github.com/user/foo'
Use
pod 'Foo', :git => '[email protected]:user/foo.git'
This will use your RSA key to authenticate.
It appears that you can create a repo specific OAuth token that can be passed as username:
https://help.github.com/articles/creating-an-access-token-for-command-line-use
https://help.github.com/articles/git-over-https-using-oauth-token
Most helpful comment
It appears that you can create a repo specific OAuth token that can be passed as username:
https://help.github.com/articles/creating-an-access-token-for-command-line-use
https://help.github.com/articles/git-over-https-using-oauth-token