OPNsense Forum

English Forums => General Discussion => Topic started by: miketubby on November 17, 2026, 11:31:10 AM

Title: Improved WebUI login with username/password and TOTP
Post by: miketubby on November 17, 2026, 11:31:10 AM
I have created a patch for the web UI login that improves the user experience when using username+password and 2FA tokens (TOTP).

The improvement does away with the requirment to manually enter the TOTP code before or after your password by accepting the username and password on the form and then replacing the password input field with "One-time token:" prompt in the same way that Keycloak does.

The change also allows your browser's password manager to remember the username and password fields, but always prompt for the 2FA token.

The change is restricted to authgui.inc where some additional code implements the third input field and hids/unhides it as necessary, captures the token and prepends or concatenates it as necessary before submitting it to the authentication backend.  No changes are needed the authentication backend/authentication factory are required.

Screen shots below.

Patch is for OPNsense 26.7.9_1 only and has been tested on two instances (my lab and production firewalls).

Full details and patch are located at https://forum.opnsense.org/index.php?topic=53355.0 (https://forum.opnsense.org/index.php?topic=53355.0)

Mike