Created on 01-17-2023 10:12 PM Edited on 12-09-2024 12:25 AM By Jean-Philippe_P
Description |
This article describes how to resolve the issue when FortiToken 2FA is bypassed if a user enters a username that is not an exact case match of account credentials configured in Active Directory. |
Scope | FortiGate SSL VPN via LDAP and RADIUS authentication with 2-factor authentication enabled. |
Solution |
Scenario: In this example, the SSL VPN user 'pearlangelica' authenticates to an LDAP server and FortiToken 2FA is enabled on the user. The exact username configured in AD is 'pearlangelica'.
When user 'pearlangelica' with FortiToken 2FA enabled enters his username that is not an exact case match 'PeArlAngElica', 2FA is bypassed. Instead of the FortiToken code prompting after successful password input, the user will be directly connected to the VPN.
2FA can be bypassed for locally defined remote users by entering the user name with mixed cases. This is because the remote LDAP server has different matching rules compared to FortiGate.
To resolve the issue, disable username-sensitivity on the user settings. By default, username-sensitivity is enabled.
Note: The setting 'username-sensitivity' is only available on CLI and when the user has 2-factor authentication enabled. If the user type is local, enabling or disabling the username-sensitivity is not feasible.
To disable username-sensitivity:
config user local edit "pearlangelica" set type ldap set two-factor fortitoken set fortitoken "FTKMOB16B40CE9D8" set email-to "<email address>" set username-sensitivity disable set ldap-server "LDAP-Server-1" next end
config user local
Once username-sensitivity is disabled on the user, it will allow the user to connect to the VPN with the prompt to enter the FortiToken code regardless of whether the user enters the exact match or inexact character match of his username.
This setting will also work on Radius with 2-factor authentication enabled.
The expected results after disabling username-sensitivity are the following:
Scenario 1: The user enters his username which is not an exact match. With username-sensitivity disabled, it will be asked to enter the FortiToken code after successful password input:
Once the password and the FortiToken code match, it will allow the user to connect to the VPN.
Scenario 2: The user enters the exact match of his username. The same with Scenario 1, with username-sensitivity disabled, the user is prompted to enter the FortiToken code after successful password input:
Once the password and the FortiToken code match, it will allow the user to connect to the VPN.
Related articles: Technical Tip: Local user, username case sensitivity and accent sensitivityTechnical Tip: Email Two-Factor Authentication on FortiGate |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.