Bonjour à tous!

Voilà je cherche à faire du SSO sous IIS. Pour ce faire j'aimerais récupérer le
login user de la session Windows.

J'ai déjà réussi à le faire sous Apache grâce à la fonction suivante travaillant
avec NTLM:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
 
<?php
 
   define('_NTLM_AUTH_FAILED',1);
   define('_NTLM_PROXY',2);
 
   function getInfosFromNTLM()
   {
    @session_start();
 
    if (!empty($_SERVER['HTTP_VIA'])) {
        return _NTLM_PROXY;
    }
 
    $header = apache_request_headers();
    $auth = isset($header['Authorization']) ? $header['Authorization'] : null;
 
    if (is_null($auth)) {
        return unAuthorized();
    }
 
    if ($auth && (substr($auth,0,4) == 'NTLM')) {
 
        $c64 = base64_decode(substr($auth,5));
        $state = ord($c64{8});
 
        switch ($state) {
 
            case 1:
                $chrs = array(0,2,0,0,0,0,0,0,0,40,0,0,0,1,130,0,0,0,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0);
                $ret = "NTLMSSP";
                foreach ($chrs as $chr) {
                    $ret .= chr($chr);
                }
                return unAuthorized(trim(base64_encode($ret)));
                break;
 
            case 3:
                $l = ord($c64{31}) * 256 + ord($c64{30});
                $o = ord($c64{33}) * 256 + ord($c64{32});
                $domain = str_replace("\0","",substr($c64,$o,$l));
 
                $l = ord($c64{39}) * 256 + ord($c64{38});
                $o = ord($c64{41}) * 256 + ord($c64{40});
                $user = str_replace("\0","",substr($c64,$o,$l));
 
                return array('domain'=>$domain,'user'=>$user);
 
                break;
 
        }
 
    }
}
 
function unAuthorized($msg=null) {
    $ntlm = 'WWW-Authenticate: NTLM';
    if ($msg) {
        $ntlm .= ' '.$msg;
    }
    header('HTTP1.0 401 Unauthorized');
    header($ntlm);
 
    return _NTLM_AUTH_FAILED;
}
 
?>
Biensûr, sous IIS, cela ne fonctionne pas étant donné que cette fonction
utilise du code propre à Apache (apache_request_headers() par exemple).

Alors ben je suis un peu perdu. Quelqu'un aurait-il de l'expérience en la
matière?
Merci d'avance!
Greg