Troubleshooting Tip: Remote LDAP authentication failure due to DN character limits
| Description | This article describes how, in certain environments, remote LDAP users may fail to authenticate with FortiAuthenticator even when their credentials appear correct. This often occurs when the user's Distinguished Name (DN) is exceptionally long. |
| Scope | FortiAuthenticator (All versions), remote LDAP/Active Directory integration. |
| Solution | Resolution:
Before making configuration changes, verify the failure reason via the FortiAuthenticator GUI. Check the Events Log and look for 'Invalid Credentials' or 'User not found' errors.
If the debug output shows 'Try to bind with username test1 because DN is over 256 bytes long', it is likely because the DN (Distinguished Name) exceeds 256 bytes/characters, as shown in the example below:
2026-02-25T14:40:09.213325+03:00 P-FortiAuthenticator radiusd[31536]: (4) facauth: Added Stripped-User-Name with value test1
Note: FortiAuthenticator by default tries to authenticate the user with the DN it received from the AD server, and if the DN is more than 256 characters, it tries to authenticate the user without a DN.
The usual solution to this issue is to shorten the user's Distinguished Name. A user's DN is made up of their Common Name (CN), the Organizational Unit(s) that contain the user, and the base Distinguished Name of the LDAP server. An example Distinguished Name for the user 'JDoe', located in OU Editors, which is contained in OU Staff and in turn OU Community, might be:
DN=CN=JDoe,OU=Editors,OU=Staff,OU=Community,DC=test,DC=lab
Depending on the structure of the LDAP tree, a user's Distinguished Name can contain a large number of elements that identify the exact location of the user object on the LDAP tree, and thus easily exceed 256 characters. To reduce the number of characters, the user should either be moved to a higher-level Organizational Unit (OU) so the distinguished name contains fewer elements, or the OU names should be shortened themselves.
Verification: Attempt the login again and verify the authentication through the event logs and RADIUS debug logs. |
