How to Customize Login Error Messages for LDAP Authentication in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2024 07:32 AM
Hy everyone,
I'm working on customizing the login experience in ServiceNow, specifically when users fail to authenticate via LDAP. By default, ServiceNow provides a generic error message like "Invalid username or password", but I need to display more specific messages based on the LDAP error codes.
For example:
If the LDAP error code is 705, I want to display: "Your account is locked. Please contact support."
For other errors like 49 (invalid credentials), I want to display: "Invalid username or password."
I understand that these error codes might be accessible in the session properties or logs, but I haven't found a clear way to dynamically capture them and map them to user-friendly messages in the UI.
Any suggestions?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2024 03:36 PM
I've not touched this myself, but my troubleshooting would lead me to look at the installation exits. A quick look shows there is a bit of logic to check LDAP connection, but not at the account level.
You may need to ask HI to know if there are any global vars specified around the specific user-account Auth process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2024 04:35 PM
I've checked the login installation exit, but it doesn't seem like it's capturing the error code in any way. It is logging the error on the syslog table, but I wanted to treat the error before the log.