I’m having a problem with NTLM v2 connection. After some changes at my workplace, my code stopped working. I checked the NTLM with the [‘Authorization’]
header, but since the Active Directory changes, the [‘Authorization’]
header is missing in my dump.
To solve this, I modified the registry key:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlLsaMSV1_0NtlmMinClientSec
setting the value to 20000000 instead of 80000. However, my system settings update every hour, and the system administrators cannot modify them permanently.
Is it possible to get the [‘Authorization’]
header with NTLM v2 without requiring a 128-bit session security?
Here is my code in Symfony:
`public static function connexionWindows()
{
$browser = self::getBrowser();
// If the user is not using Windows, or if the browser is not Chrome or IE, fail
if ($browser['platform'] != "windows" or ($browser['name'] != 'Google Chrome' and $browser['name'] != 'Internet Explorer')) {
return false;
}
$headers = apache_request_headers(); // Retrieve client headers
dump($headers);
if (@$_SERVER['HTTP_VIA'] != NULL) { // Check if a proxy is used: NTLM authentication cannot pass through a proxy
return false;
} elseif (!isset($headers['Authorization'])) { // If the Authorization header is missing
header("HTTP/1.1 401 Unauthorized"); // Send the authentication mode to the client
header("Connection: Keep-Alive");
header("WWW-Authenticate: Negotiate");
header("WWW-Authenticate: NTLM"); // In our case, NTLM
exit;
}
Example of dump($headers) before the update:
"Host" => "XXXXXX" "Connection" => "keep-alive" "Cache-Control" => "max-age=0" "Authorization" => "NTLM TlRMTXXXXXXXX" "sec-ch-ua" => ""Not/A)Brand";v="8", "Chromium";v="126", "Microsoft Edge";v="126"" "sec-ch-ua-mobile" => "?0"
Example of dump($headers) after the update:
"Host" => "XXXXXX" "Connection" => "keep-alive" "Cache-Control" => "max-age=0" "sec-ch-ua" => ""Not/A)Brand""
can you help me please ?
I can’t find any similar problem
Brice is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.