|  | 
  Guilleaume Valery - 2005-10-24 13:09:03Hello,
 Thank you for the good work. I have only a little problem with the test_http.php. I would like to use it on a url with a NTLM authentication.
 
 For that, I have put in the code of test_http.php :
 
 ...
 $user="myuser";          /* It's a local user on the server */
 $password="mypassword";
 $realm="nameofserver";       /* It's local on the server */
 $workstation="????"; /* I don't know if I must put the name of the  client or the server ; with the FQDN or not ? */
 ...
 
 Could you help me, because when I start the script, I have this error :
 
 <HTML>
 <HEAD>
 <TITLE>Test for Manuel Lemos' PHP HTTP class</TITLE>
 </HEAD>
 <BODY>
 <H1><CENTER>Test for Manuel Lemos' PHP HTTP class</CENTER></H1>
 <HR>
 <UL>
 <H2><LI>Opening connection to:</H2>
 <PRE>myserver</PRE>
 Resolving HTTP server domain "myserver"...<br />
 Connecting to HTTP server IP ipaddressofserver...<br />
 Connected to myserver<br />
 <H2><LI>Sending request for page:</H2>
 <PRE>/perfnettest/
 
 Login:    mylogin
 Password: *******</PRE>
 C GET /perfnettest/ HTTP/1.1<br />
 C Host: myserver.fqdn:81<br />
 C User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)<br />
 C Pragma: nocache<br />
 C <br />
 <H2><LI>Request:</LI</H2>
 <PRE>
 GET /perfnettest/ HTTP/1.1</PRE>
 <H2><LI>Request headers:</LI</H2>
 <PRE>
 Host: myserver.fqdn:81
 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
 Pragma: nocache
 </PRE>
 S HTTP/1.1 401 Unauthorized<br />
 S Content-Length: 1656<br />
 S Content-Type: text/html<br />
 S Server: Microsoft-IIS/6.0<br />
 S WWW-Authenticate: Negotiate<br />
 S WWW-Authenticate: NTLM<br />
 S Date: Mon, 24 Oct 2005 12:43:52 GMT<br />
 S <br />
 Disconnected from myserver.fqdn<br />
 <CENTER><H2>Error: authentication error: authentication mechanism NTLM may not be used: the requested credential user is not defined</H2><CENTER>
 </UL>
 <HR>
 </BODY>
 </HTML>
 
 Thank you very much,
 
 Valéry Guilleaume
  Manuel Lemos - 2005-10-24 16:25:14 - In reply to message 1 from Guilleaume ValeryIt is hard to tell without seeing your script. 
Anyway, to authenticate you should be specifying a URL like this:
 user:password@domain/page
where user and password are the UrlEncode versions of the user and password that you need to access.
 
You may also set the user and password with the AuthUser and AuthPassword connection arguments.
  Guilleaume Valery - 2005-10-25 12:10:26 - In reply to message 2 from Manuel LemosHello,
 For a NTLM authentication I must also use this type of authentication http://user:password@domain/page ? I thinked that I must fill (in your example test_http.php) the fields : $user="myuser";$password="mypassword";$realm="nameofserver";$workstation="????";
 And it will be ok with that.
 
 My script is very like your exemple. For the moment, I only try to do a connection on a web page with NTLM credentials.
 
 Thank you very much for your help,
 
 Valéry
  Manuel Lemos - 2005-10-25 16:20:59 - In reply to message 3 from Guilleaume ValeryAs I said, you do not need to specify the user and password in the URL if you set the AuthUser and AuthPassword arguments. 
 The example takes the $user and  $password variables to form the URL. But you can do it in whatever way it pleases you.
 
 The realm (Windows domain) and workstation name are set in the arguments from the respective variables.
  Cyril GIRONDE - 2006-01-30 12:52:28 - In reply to message 4 from Manuel LemosHi Manuel, 
 How i can cancel the auth NTLM
 Because i canot use POST & GET
 i can register login domain host in session but after i cannot use my standart script with form post & get
 
 tanks
 
 best regards
 
 cyril
  Manuel Lemos - 2006-01-30 19:50:41 - In reply to message 5 from Cyril GIRONDEYou cannot disable the NTLM authentication without changing the SASL library. What you can do is to tell the HTTP class that you want to give priority to some other authentication method, setting the authentication_mechanism .
 However, I suspect that it is your server that is requiring NTLM authentication and you may not be able to access without authenticating with NTLM.
 |