Hello FreeRADIUS and PrivacyIDEA communities,
I am setting up PrivacyIDEA (v3.11.1) with FreeRADIUS (v3.0.26, Ubuntu 22.04.5 TLS) to provide AD + TOTP authentication for a SonicWall SSL VPN. I am using the native Perl-based rlm_privacyidea
module installed via the privacyidea-radius
package (v3.4.3).
I have encountered a persistent issue where all authentication attempts fail with the error “RADIUS Authentication Failed” on the SonicWall, and the FreeRADIUS debug logs consistently show Reply-Message = "wrong otp pin"
received from the PrivacyIDEA API. The token’s fail counter in the PrivacyIDEA web UI also increases.
Here’s a summary of my setup and debugging steps:
- Setup:
- FreeRADIUS is configured to use the native Perl module (
rlm_privacyidea
viarlm_perl
) instantiated asprivacyidea
in theauthorize
section of a virtual server (configured insites-enabled/privacyidea
). - The Perl module config (
/etc/freeradius/3.0/mods-available/privacyidea
) usesprivacyidea_server = "https://localhost"
,privacyidea_auth_mode = "totp"
, and SSL verification is effectively disabled (confirmed in logs:rlm_perl: Not verifying SSL certificate: false
). - PrivacyIDEA is running on the same server (192.168.1.50) with an AD resolver and TOTP tokens assigned to users.
- The SonicWall is configured as a RADIUS client sending
Access-Request
to the FreeRADIUS server (192.168.1.50:1812) using theADPassword + OTP
combined password format and SAMAccountName username format.
- FreeRADIUS is configured to use the native Perl module (
- Debugging Performed (and results):
- Confirmed network connectivity from SonicWall to FreeRADIUS and from FreeRADIUS to PrivacyIDEA API (
https://localhost/validate/check
) usingcurl
(API is reachable and responds). - Confirmed FreeRADIUS loads the native Perl module correctly (no
.so
errors after installingprivacyidea-radius
package). - Confirmed PrivacyIDEA API communication is happening during authentication attempts (logs show
rlm_perl: url: https://localhost/validate/check
,user sent to privacyidea: ...
,pass sent to privacyidea: ...
,elapsed time: ...
,privacyIDEA Result status is true!
). - Confirmed FreeRADIUS sends the correct username (SAMAccountName) and the complete combined password string to the PrivacyIDEA API via the Perl module.
- Crucially: Confirmed server time is accurate (NTP synchronized).
- Crucially: Successfully performed the token resync test in the PrivacyIDEA web UI for the user’s token (entering current and next OTPs).
- Verified user and token status in PrivacyIDEA (enabled, not locked).
- Verified the PrivacyIDEA token/policy setting “Prepend the PIN in front of the OTP value” is checked, matching the
ADPassword + OTP
input format.
- Confirmed network connectivity from SonicWall to FreeRADIUS and from FreeRADIUS to PrivacyIDEA API (
- Specific Observation (Combined Password Format): The AD passwords for the users I’m testing end in symbols immediately followed by digits (e.g.,
ADPasswordEndingIn!)
orADPasswordEndingIn//
). The combined password sent isADPasswordEndingIn!)OTP
orADPasswordEndingIn//OTP
. The logs show the full string being sent to the API. - Problem Diagnosis: Given that the PrivacyIDEA API is reached, the combined password string is sent, time is correct, token resync is successful, and the “Prepend” setting is correct, but PrivacyIDEA still returns “wrong otp pin”, I suspect there might be an edge case or a bug in PrivacyIDEA’s combined password splitting (
splitToken
) or subsequent OTP validation logic when the AD password part ends in symbols (like!
,/
, etc.) immediately followed by numeric OTP digits. This might cause PrivacyIDEA to incorrectly parse the string or fail the OTP check for that specific password structure. - Request for Assistance: Has anyone encountered a similar issue where “wrong otp pin” persists after successful resync, particularly when the AD password ends in symbols just before the OTP? Is this a known limitation or bug in PrivacyIDEA or the
rlm_privacyidea
module (Perl version)? Are there any further diagnostics I can perform on the PrivacyIDEA side or within the Perl module to pinpoint why the OTP validation is failing for this specific password structure?
I can provide the relevant FreeRADIUS configuration files (/etc/freeradius/3.0/mods-available/privacyidea
, /etc/freeradius/3.0/sites-enabled/privacyidea
) and full sudo freeradius -X
debug logs upon request.
Thank you for your time and any insights you can provide.