| Project: | Webserver authentication |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
Please see http://drupal.org/node/98157 for info to start with.
I have investigated this and have managed to solve the issue. Using NTLM authentication Internet Explorer will by default send usernames and passwords encoded as 'Windows-1252'. This is not compatible with what webserver auth expects. This code:
<?php
if (mb_detect_encoding($name, array(
'utf-8', 'windows-1252') == 'windows-1252')) {
$name = drupal_convert_to_utf8($name, 'windows-1252');
}
?>placed just after:
<?php
if ($name = $_SERVER["REMOTE_USER"]) {
?>will detect and alter the encoding of the string to allow it to work. Unfortunately it uses a specific mb_string function call as drupal does not provide a wrapper function. The reason that entering the user through the interface works correctly is that Internet Explorer will send the string UTF8 encoded as the user/register page requests it.
I'll understand if this code (or something like it) doesn't appear in webserver_auth as it is quite case specific. But it's worth keeping in mind as this could conceivably affect anybody using non ascii characters on a win32 apache instance using mod_auth_sspi (see, ;-) case specific).
Thanks
Adam