-
Notifications
You must be signed in to change notification settings - Fork 989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to use two factor authentication (2FA) like Google Authenticator with Conan? #4266
Comments
Hi @Aalmann! Conan supports custom authentications: https://docs.conan.io/en/latest/uploading_packages/running_your_server.html#authentication I've created a plugin for LDAP (as example): https://github.com/uilianries/conan-ldap-authentication To implement a plugin for OAuth I think won't be complicated, based on my past work using google-auth-oauthlib. It uses requests-oauthlib to authenticate, so your plugin could check the token generated by the OAuth server. According Artifactory's docs it has support for OAuth, but I don't know about 2FA. |
I am not sure if I understand the question. Are you talking about the conan_server? If anything, it would be similar to Github: https://help.github.com/articles/accessing-github-using-two-factor-authentication/#using-two-factor-authentication-with-the-command-line Artifactory already has user tokens, I think they might be used as password from the client side too, but need to check. |
No not conan_server (and I think I didn't wrote it 😄). Our setup is:
So the question is: How to configure Conan client for using that setup. |
I have no idea about it. But with Artifactory tokens, you can use the token like a password and Artifactory will accept it. So if with google auth code you can then get a token or something similar you might be able to use it. |
I think is not so simple, for Google 2FA you will need to create a Google Dev account and a new application there to provide a QR code to be used with Google Authenticator, and of course, Artifactory token will not work, bacause the token is based on Google side. This feature should be developed by Artifatory team, where they could provide a QR Code on web interface to be added on Google Authenticator app. So the temporary token provided by the app should be used for Conan authentication. However, in my experience, performing 2FA authentication over CI jobs could cause headache for days. But the question is, why do you need this? 2FA is really good for distributed applications that you can access around the world, like gmail, github, ... but Conan is a client and usually runs only in your company. |
Again, you will to create a plugin with all Google stuff. Fortunately, Google has a good python API and a big community to help. You will need to execute some steps in your plugin:
|
@lasote @uilianries |
I don't know if it makes sense. I would need an example of a client tool using Google Auth to login against a server. But eventually (irrespective of the authentication process with the server) you could get a token, so I thought that maybe it would be Artifactory responsibility to generate an access token for Conan. Once the token is created it will be valid until it expires, but from my perspective, it has nothing to do anymore with Google Auth. But again, I have no idea about this. |
I almost forgot about VPN case, now your case is more clear. When I said about "plugin" actually it means docs.conan.io/en/latest/uploading_packages/running_your_server.html#authentication It works like an extension, as you commented. |
@uilianries @lasote |
We're in the same boat. Have artifactory (ec2 instance in AWS), don't want vpn, need 2fa. Is that even possible? |
Artifactory provides OAuth authentication: https://www.jfrog.com/confluence/display/RTF/OAuth+Integration I know it's not same thing, but at least you can integrate to other services like Google. The problem that I see using 2FA is providing an extra box to show a token. |
This has been closed by #16942, which adds users plugins for custom auth (conan won't provide the specific auth as built-in, just the plugin to allow users to provide their own). It will be in next Conan 2.8, thanks for the feedback! |
Hi @memsharded and @lasote ,
I have a question concerning 2FA with conan.
Especially in enterprise environments a 2 factor authentication is often used to secure the access to various applications (like JIRA, Artifactory, etc.).
I didn't find any information about 2FA@conan.
Are there any experiences with Google Authenticator or similar applications (Microsoft Authenticator, FreeOTP, Keepass/KeyOTP, etc.) and how to use them with conan?
If not, is there any feature planned?
Thanks in advance.
Best Aalmann
The text was updated successfully, but these errors were encountered: