I would like the openVPN client to prompt the user / password in first step, as it is now, but then, for the second challenge, it should show up with a new popup windows, with a single field : "please enter OTP".How can I acheive that ?
static-challenge "Please enter your OpenOTP PIN" 1
--static-challenge t eEnable static challenge/response protocol using challenge text t, with echo flag given by e (0|1).The echo flag indicates whether or not the user's response to the challenge should be echoed.See management-notes.txt in the OpenVPN distribution for a description of the OpenVPN challenge/response protocol.
setenv FRIENDLY_NAME "Reiners OPNSense Test"
static-challenge "Enter Authenticator Code" 1
Hi, thanks for the idea. Of course I can add Code: [Select]static-challenge "Enter Authenticator Code" 1 at the client which then requests seperately password and OTP. But how does the server know how to handle this information? The server has to be somehow instructed how to concatenate the PWD+CODE.
$ git show -p b528952260commit b5289522604b7863a5b3bd8c8a5a21a334b1f59cAuthor: Ad Schellevis <ad@opnsense.org>Date: Thu Mar 16 10:26:43 2023 +0100 VPN/OpenVPN - add missing static-challenge parsing, should fix https://forum.opnsense.org/index.php?topic=32939.msg159861#msg159861diff --git a/src/opnsense/scripts/openvpn/user_pass_verify.php b/src/opnsense/scripts/openvpn/user_pass_verify.phpindex 7aebdf282..3fb4be2c8 100755--- a/src/opnsense/scripts/openvpn/user_pass_verify.php+++ b/src/opnsense/scripts/openvpn/user_pass_verify.php@@ -96,6 +96,18 @@ function do_auth($common_name, $serverid, $method, $auth_file) if (empty($username) || empty($password)) { return "username or password missing ({$method} - {$auth_file})"; }+ if (strpos($password, 'SCRV1:') === 0) {+ // static-challenge https://github.com/OpenVPN/openvpn/blob/v2.4.7/doc/management-notes.txt#L1146+ // validate and concat password into our default pin+password+ $tmp = explode(':', $password);+ if (count($tmp) == 3) {+ $pass = base64_decode($tmp[1]);+ $pin = base64_decode($tmp[2]);+ if ($pass !== false && $pin !== false) {+ $password = $pin . $pass;+ }+ }+ } $a_server = $serverid !== null ? get_openvpn_server($serverid) : null; if ($a_server == null) { return "OpenVPN '$serverid' was not found. Denying authentication for user {$username}";