NTLM authentifizierung und fremde Browser

From: Hauke Fuhrmann (hauke.fuhrmann_at_airbus.com)
Date: 05/24/04


Date: Mon, 24 May 2004 07:51:47 -0700

Hallo,

ich habe auf einem Rechner den IIS laufen, der webseiten
nur über die Windows interne authentifizierung verteilt.
Also wenn ich nun mit nem Browser so eine Seite anfordere,
gibts von server die Antwort 401 Access Denied und die
Aufforderung mich via NTLM zu authentifizieren.

Ich kann nun nicht den MS Internet Explorer benutzen,
sondern muss eine solche Seite mit einem Kommandozeilen
Tool runterladen. Am liebsten möchte ich dafür Java
benutzen, also verwende ich den Java Apache Commons
httpclient 2.0 für die Angelegenheit, der auch NTLM kann.

Während mit dem Internet Explorer alles glatt läuft, lehnt
der IIS den Request mit dem Apache httpclient ab und da
alle Daten verschlüsselt übertragen werde, weiß ich
absolut nicht warum. Beide Logfiles - sowohl vom
httpclient als auch vom IIS - zeigen nur an, DASS die
Authentifizierung nicht geklappt hat, aber nicht, warum
sie nicht geklappt hat.

Gibts ne Möglichkeit, die Ursache rauszufinden? Kann man
den IIS dazu bringen, mehr Informationen ins Logfile zu
schreiben? Gibts ne andere Möglichkeit, via Kommandozeile
eine durch NTLM geschützte Seite vom IIS zu bekommen?

Hoffe, mir kann irgendjemand helfen,
vielen Dank im Voraus,
Hauke

Ich häng hier nochmal das logfile vom http client an, das
aber nicht viel mehr aussagt als dass die
Authentifizierung am Ende fehlschlägt, obwohl der
Handshake in der Mitte schonmal gar nicht so schlecht
aussieht

[DEBUG] HttpClient - -Java version: 1.4.2
[DEBUG] HttpClient - -Java vendor: Sun Microsystems Inc.
[DEBUG] HttpClient - -Operating system name: Windows 2000
[DEBUG] HttpClient - -Operating system architecture: x86
[DEBUG] HttpClient - -Operating system version: 5.0
[DEBUG] HttpClient - -SUN 1.42: SUN (DSA key/parameter
generation; DSA signing; SHA-1, MD5 digests; SecureRandom;
X.509 certificates; JKS keystore; PKIX CertPathValidator;
PKIX CertPathBuilder; LDAP, Collection CertStores)
[DEBUG] HttpClient - -SunJSSE 1.42: Sun JSSE provider
(implements RSA Signatures, PKCS12, SunX509 key/trust
factories, SSLv3, TLSv1)
[DEBUG] HttpClient - -SunRsaSign 1.42: SUN's provider for
RSA signatures
[DEBUG] HttpClient - -SunJCE 1.42: SunJCE Provider
(implements DES, Triple DES, AES, Blowfish, PBE, Diffie-
Hellman, HMAC-MD5, HMAC-SHA1)
[DEBUG] HttpClient - -SunJGSS 1.0: Sun (Kerberos v5)
[DEBUG] HttpClient - -Credentials for default
authentication realm: username:rootadmin password:afis-
ansu-2100 host:D0157782 domain:afis.rockwellcollins.com
[DEBUG] HttpConnection - -HttpConnection.setSoTimeout(0)
[DEBUG] HttpMethodBase - -Execute loop try 1
[DEBUG] wire - ->> "GET /bmi/fault_report.xml HTTP/1.1[\r]
[\n]"
[DEBUG] HttpMethodBase - -Adding Host request header
[DEBUG] wire - ->> "User-Agent: Jakarta Commons-
HttpClient/2.0final[\r][\n]"
[DEBUG] wire - ->> "Host: ansu[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.1 401 Access Denied[\r][\n]"
[DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]"
[DEBUG] wire - -<< "Date: Mon, 03 May 2004 12:47:03 GMT[\r]
[\n]"
[DEBUG] wire - -<< "WWW-Authenticate: Negotiate[\r][\n]"
[DEBUG] wire - -<< "WWW-Authenticate: NTLM[\r][\n]"
[DEBUG] wire - -<< "Connection: close[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 24[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] HttpMethodBase - -Authorization required
[DEBUG] HttpAuthenticator - -Authenticating with the
default authentication realm at ansu
[DEBUG] HttpMethodBase - -HttpMethodBase.execute(): Server
demanded authentication credentials, will try again.
[DEBUG] wire - -<< "Error: Access is Denied."
[DEBUG] HttpMethodBase - -Should close connection in
response to Connection: close
[DEBUG] HttpMethodBase - -Execute loop try 2
[DEBUG] HttpMethodBase - -Opening the connection.
[DEBUG] wire - ->> "GET /bmi/fault_report.xml HTTP/1.1[\r]
[\n]"
[DEBUG] HttpMethodBase - -Request to add Host header
ignored: header already added
[DEBUG] wire - ->> "User-Agent: Jakarta Commons-
HttpClient/2.0final[\r][\n]"
[DEBUG] wire - ->> "Host: ansu[\r][\n]"
[DEBUG] wire - ->> "Authorization: NTLM
TlRMTVNTUAABAAAABlIAABgAGAAoAAAACAAIACAAAABEMDE1Nzc4MkFGSVM
uUk9DS1dFTExDT0xMSU5TLkNPTQ==[\r][\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.1 401 Access Denied[\r][\n]"
[DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]"
[DEBUG] wire - -<< "Date: Mon, 03 May 2004 12:47:03 GMT[\r]
[\n]"
[DEBUG] wire - -<< "WWW-Authenticate: NTLM
TlRMTVNTUAACAAAABAAEADAAAAAGAoEAfy2cSecyuJ8AAAAAAAAAAI4AjgA
0AAAAQUZJUwIACABBAEYASQBTAAEACABBAE4AUwBVAAQAMABhAGYAaQBzAC
4AcgBvAGMAawB3AGUAbABsAGMAbwBsAGwAaQBuAHMALgBjAG8AbQADADoAY
QBuAHMAdQAuAGEAZgBpAHMALgByAG8AYwBrAHcAZQBsAGwAYwBvAGwAbABp
AG4AcwAuAGMAbwBtAAAAAAA=[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 24[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] HttpMethodBase - -Authorization required
[DEBUG] HttpAuthenticator - -Authenticating with the
default authentication realm at ansu
[DEBUG] HttpMethodBase - -HttpMethodBase.execute(): Server
demanded authentication credentials, will try again.
[DEBUG] wire - -<< "Error: Access is Denied."
[DEBUG] HttpMethodBase - -Resorting to protocol version
default close connection policy
[DEBUG] HttpMethodBase - -Should NOT close connection,
using HTTP/1.1.
[DEBUG] HttpMethodBase - -Execute loop try 3
[DEBUG] wire - ->> "GET /bmi/fault_report.xml HTTP/1.1[\r]
[\n]"
[DEBUG] HttpMethodBase - -Request to add Host header
ignored: header already added
[DEBUG] wire - ->> "User-Agent: Jakarta Commons-
HttpClient/2.0final[\r][\n]"
[DEBUG] wire - ->> "Host: ansu[\r][\n]"
[DEBUG] wire - ->> "Authorization: NTLM
TlRMTVNTUAADAAAAGAAYAGkAAAAAAAAAgQAAABgAGABAAAAACQAJAFgAAAA
IAAgAYQAAAAAAAACBAAAABlIAAEFGSVMuUk9DS1dFTExDT0xMSU5TLkNPTV
JPT1RBRE1JTkQwMTU3NzgyJGvqRAbUDMau2Xvs7/czsCLtV0s5fmPn[\r]
[\n]"
[DEBUG] wire - ->> "[\r][\n]"
[DEBUG] wire - -<< "HTTP/1.1 401 Access Denied[\r][\n]"
[DEBUG] wire - -<< "Server: Microsoft-IIS/5.0[\r][\n]"
[DEBUG] wire - -<< "Date: Mon, 03 May 2004 12:47:05 GMT[\r]
[\n]"
[DEBUG] wire - -<< "WWW-Authenticate: Negotiate[\r][\n]"
[DEBUG] wire - -<< "WWW-Authenticate: NTLM[\r][\n]"
[DEBUG] wire - -<< "Connection: close[\r][\n]"
[DEBUG] wire - -<< "Content-Length: 24[\r][\n]"
[DEBUG] wire - -<< "Content-Type: text/html[\r][\n]"
[DEBUG] HttpMethodBase - -Authorization required
[INFO] HttpMethodBase - -Already tried to authenticate
with 'null' authentication realm at ansu, but still
receiving: HTTP/1.1 401 Access Denied
[DEBUG] HttpMethodBase - -Buffering response body
[DEBUG] wire - -<< "Error: Access is Denied."
[DEBUG] HttpMethodBase - -Should close connection in
response to Connection: close

Error: Access is Denied.



Relevant Pages