Impersonation is failing for specific user(s). The following symptoms are present:
- Attempt to impersonate a user
- You are redirected unexpectedly to the login screen (ends current session)
All current releases
This happens when there is an unexpected white space before OR after the affected user's User ID [sys_user.user_name] value. Typically this is an unintentional update on the User's form. This screenshot shows the space prepending the value, but it could also be found at the end of the string.
Edit the [sys_user.user_name] value to remove the unexpected character and save. You should then be able to impersonate the user.
ServiceNow has documented this issue in 2 Problem records with no current plan to address the behavior.
- PRB619211 - Not able to impersonate to a user with a space at the end of user_name (e.g. "test_user007 ")
- PRB632747 - If sys_user.user_name has a leading space, admins will be logged out when trying to impersonate them
Not what you're looking for? Here are some additional resources which may help if you're troubleshooting an impersonation issue.