Cocoapods: Two Factor Authentication

Created on 5 Nov 2013  路  8Comments  路  Source: CocoaPods/CocoaPods

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.

awaiting input

Most helpful comment

All 8 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hmistry picture hmistry  路  3Comments

pallaviMN picture pallaviMN  路  3Comments

Curtis-Halbrook picture Curtis-Halbrook  路  3Comments

iosdev-republicofapps picture iosdev-republicofapps  路  3Comments

evermeer picture evermeer  路  3Comments