After configuring CA SAM authentication as single sign-on via NTLM on Windows, users aren't automatically logging in and are being presented with the login screen.
There are several parameters which are used to enable NTLM authentication in Windows:
security_ntlm_server_var - key of the $_SERVER variable the user credential is found in if not set defaults to LOGON_USER.
security_ntlm_authenticate_against - column name of table users the string found in security_ntlm_server_var is matched against if not set defaults to login
security_ntlm_user_search - search for this string/regular expression in content of server var. The documentation uses [A-Z0-9]+\\([a-zA-Z0-9]+)as an example. This will match any string consisting of uppercase characters and numbers. followed by a slash character and then a string consisting of uppercase characters, lowercase characters and numbers.
security_ntlm_user_replace - replace matches with this string/expression. The documentation uses \1, which means the contents of the first capturing group.
When a user tries to access CA SAM, the following steps are followed:
Using the settings from the documentation, an example of this is:
This means that the user cannot be authenticated, so the logon fails.
When the LOGON_USER string is used as the incoming Windows user, it will normally contain domain\username. In this situation the security_ntlm_user_replace parameter should be set to \2 rather than \1, so that the replacement uses the second capture string (which is the username), rather than the first capture string (which is the domain name). The username will then be validated against the database and if there is a match, the user will be logged in successfully.
The security_ntlm_user_search parameter may need further modification depending on your system configuration and usernames which are in use. The value suggested in the documentation, [A-Z0-9]+\\([a-zA-Z0-9]+) will match DOMAIN\username. It will not match TEST-DOMAIN\username (because of the hyphen character in the domain name), domain\username (because of the lower case domain name), or DOMAIN\usernàme (because of the accented character in the username).
The hyphen character is a valid character in a domain name, so if your domain name includes a hyphen characters, you will need to modify the security_ntlm_user_search so that the domain name includes a hyphen character. The correct regular expression for this would then be [A-Z0-9\-]+\\([a-zA-Z0-9]+).
For other situations which arise, please investigate the best regular expression to use to successfully match the LOGON_USER value.