-
Notifications
You must be signed in to change notification settings - Fork 406
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
Textbox for 2fa security code #663
Comments
That seems like your setup uses a non-standard way to request 2FA and having it as part of the password. The normal OpenVPN methods (static-challenge, dynamic-challenge and crtext) do not need to split password method. |
@schwabe This is the second company where I've encountered such an approach. Moreover, some VPN clients, like Tunnelblick, implement this functionality, and when I was using a mac, it was a great help to me. I think that since the authors of Tunnelblick have implemented support for combining a password and OTP, this functionality is still in demand, even though it's not encountered frequently. |
I have the same problem with one company. All the time we used OpenVPN GUI for Windows to connect to them remotelly. Everything was fine. |
@zsolks that seems to be more that those products seem to blatenly ignore the normal methods to use 2FA with OpenVPN. |
client logfile or it did not happen... 2FA in a combined password (secret+token) works just fine, you just need to ensure that you do not check "[x] save password" in GUI |
@schwabe well... so do we... it's an old setup, and the OTP handling is done in the PAM stack, so it wants "secret+token in the password field". Of course it could be modernized, but since it works as is and users know how to get in, I never felt like investing time. |
The best way we can probably do is to have a --static-challenge flag or similar that produces the password+otp token format instead of the SCRV1:<password_base64>:<response_base64> that is normally used when you use static-challenge |
I do not know, but Stormshield works. :/ Im, not admin and never setup openvpn server yet so I, can't polemize with youre technical stuff.
like always, and it was working, until now, until They enabled 2FA. @cron2 I do not save and not checked checkbox save password. Maybe this information help somebody to solve problem. Maybe attachments help to solve some problems, give look on my config, and situation config.ini
openvpn_client.ovpn
|
opnsense openvpn integration works that way for example - so we have the same problem with all our opnsense customers - as this method (password+otp in one field) is way too inconvient we couldnt convice any of our customers to add an otp that would be so badly needed to improve our security. so any "hack" or adding of an optional additional field for that way to implement an otp would be a great improvment for us |
Its unclear to me what exactly the question is, if there is one. There is no hack required. OpenVPN-GUI out of the box supports inputting password and OTP as separate fields. Depending on how MFA is enforced by the server, this may require The simplest option is to use the so-called "static challenge": the GUI dialog will have three fields for username, password, and OTP, it will internally encode them following the static-challenge protocol and submit to the server. On the server side, |
If you really need this different behaviour, I suggest that you implement a patch for OpenVPN 2.x (and probably also 3.x) that allows an argument for static-challenge to switch to this different (inferior) encoding to append password and challenge without base64 encoding. There will be probably no one else taking up that task since decoding the normal static-challenge on the server side with whatever auth backend you are using is trivial enough and does not require new clients to be installed everywhere. |
I’m currently working on a project where authentication requires password+OTP concatenation. This is indeed quite annoying since it does not allow saving the password, nor echoing the OTP (I tried From reading this forum thread, it seems to be a common issue with RADIUS. |
The problem is not with RADIUS, but the radius plugin for OpenVPN. I do not know who maintains it but it should be easy to fix -- we have the necessary functions to pick apart static challenge response in auth-pam plugin. The radius plugin could copy it. |
If radius is only used for authentication,
|
The thing is, even when those plugins get fixed, people still have to deal with servers using the old version, so support in the client would remain useful. (I understand well that you don’t want to put effort in this, and that contributions are welcome) |
To support these nonstandard behaviour one would have to construct something like "password:OTP". But then what happens if password contains ':' character? Or, some may want a different separator or assume OTP to be a fixed number of digits.. It would be such an ugly hack that has no place in the GUI or OpenVPN (IMHO). So "contributions are welcome" is not my stand on this. Either fix the server-side processing (its not at all hard to parse the SCRV1 format), or continue to just manually submit the password as "password:OTP". I do not see any "old servers" issue here. Updating server is so much easier to deploy than updating numerous clients. |
I wanted to give it a shot, so I implemented something in 458fcc3. To use it, you must create a I went for a registry key because:
Just to reply to @selvanair:
My understanding is that these implementations just take the last 6 digits (no separator or prefix is needed) but I agree that maybe it won’t work for everyone.
Unfortunately I have no control on the server-side of things. I am just a poor user who has to deal with this server. I have asked to change it and the answer was that they don’t have the time for this. To be fair, it’s probably not just a matter of updating the server, since proper testing must be done upfront. Moreover, requesting a static challenge would require everyone to change their ovpn config file. And as one says: if it ain’t broke… In any case, from my position, the only thing I can do is use a client that satisfies my needs. I could submit a PR if desired. |
@DidierLoiseau, perhaps a new parameter in the client config / command argument would better fit into the design of the application. |
@PiRomant the problem with the client config is that it is not used by OpenVPN-GUI, and I don’t think a command-line argument would be very convenient either (since it wouldn’t be per-connection). I think what could be done instead is to add a checkbox for it, and always display the field (disabled when the checkbox isn’t checked). I’m pretty sure that is what TunnelBlick does (see it described here and screenshots here and here) but I don’t have a Mac to check it. The benefit of the checkbox (and the registry key I implemented) is that it won’t try to reconnect automatically. If I’m not wrong, you aren’t involved in OpenVPN(-GUI) development, but previous comments on this issue seem to suggest that a PR wouldn’t be accepted anyway. |
Registry keys are meant for the GUI's internal use for persisting settings. We want to have all user options set from the UI or come from the config file. Except for a couple of admin-controlled registry keys.
I have proposed a minor extension of the If accepted, the desired support in the GUI is very easy to implement as in here: selvanair@c4c914b |
If anyone wants to try this now use an executable from the CI artifacts here: https://github.com/selvanair/openvpn-gui/actions/runs/9524885876#artifacts This one has two options for OTP concatenation: (i) a checkbox in general settings to globally enable OTP box for all configs or (ii) use (i) is usable without any support in OpenVPN.exe, but a side effect is that an OTP field will always appear in the auth-user-pass dialogs: one has to just leave it blank if not required. Configurations that need SCRV1-formatted response will continue to work. |
@selvanair Thank you in advance |
Extract the downloaded zip to a folder, stop any running openvpn-gui (right click, exit). Then double click on the openvpn-gui.exe in the extracted zip folder to run this patched version. Or run from command line as .\openvpn-gui.exe from that folder. Note that nothing is being installed, so the existing short cut on the desktop will continue to point to the currently installed version. As usual, the GUI icon will show up in the tray. Go to the settings menu, "general" tab and look for the new setting at the bottom. Make sure you are downloading from the correct link -- here it is again: |
@selvanair For me all is working with OTP now. Now i Can use OpenVpn to connect to them :] |
The problem was, i did not switch from German to English.... But thank you for your great work!!!!! |
Yes, its a WIP, changes not copied to all langauge files as yet. Will open a PR with full localization when my patch to extend static-challenge in OpenVPN core is accepted. |
Could you please add an optional additional text box for one-time passwords for cases where connecting to the VPN requires a combination of a permanent password and OTP? It would be convenient to have the option to save the permanent part of the password and only input the OTP.
The text was updated successfully, but these errors were encountered: