From 87bbf0c0e1a4a71b036daedfece1f79233cd6d35 Mon Sep 17 00:00:00 2001 From: Oleg Kalnichevski Date: Wed, 28 Oct 2009 20:38:54 +0000 Subject: [PATCH] Added detailed section on NTLM auth git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@830754 13f79535-47bb-0310-9956-ffa450edef68 --- src/docbkx/advanced.xml | 2 +- src/docbkx/authentication.xml | 84 ++++++++++++++++++++++++++++++----- 2 files changed, 75 insertions(+), 11 deletions(-) diff --git a/src/docbkx/advanced.xml b/src/docbkx/advanced.xml index e20120671..5f6a07304 100644 --- a/src/docbkx/advanced.xml +++ b/src/docbkx/advanced.xml @@ -120,7 +120,7 @@ class MyClientConnManager extends SingleClientConnManager { -
+
Stateful HTTP connections While HTTP specification assumes that session state information is always embedded in HTTP messages in the form of HTTP cookies and therefore HTTP connections are always diff --git a/src/docbkx/authentication.xml b/src/docbkx/authentication.xml index 9841d4de9..a4e26a1b1 100644 --- a/src/docbkx/authentication.xml +++ b/src/docbkx/authentication.xml @@ -109,10 +109,9 @@ pwd NTLM: NTLM is a proprietary authentication scheme developed by Microsoft and optimized for Windows platforms. NTLM is believed to be more secure than - Digest. This scheme is supported only partially and requires an external - NTLM engine. For details please refer to the - NTLM_SUPPORT.txt document included with HttpClient - distributions. + Digest. This scheme is requires an external NTLM engine to be functional. + For details please refer to the NTLM_SUPPORT.txt document + included with HttpClient distributions. @@ -206,12 +205,12 @@ httpclient.getParams().setParameter(AuthPNames.PROXY_AUTH_PREF, authpref); Please note NTLM and SPNEGO schemes are - NOT registered per default. For details on how to enable - NTLM support please refer to the - NTLM_SUPPORT.txt document included with HttpClient distributions. - SPNEGO setup tends to be system specific and must be properly - configured in order to be functional. See section on SPNEGO - authentication for details. + NOT registered per default. The NTLM cannot + be enabled per default due to licensing and legal reasons. For details on how to + enable NTLM support please see this + section. SPNEGO setup tends to be system specific and must be + properly configured in order to be functional. See this + section for details.
Credentials provider @@ -378,6 +377,71 @@ httpclient.addRequestInterceptor(preemptiveAuth, 0); ]]>
+
+ NTLM Authentication + Currently HttpClient does not provide support for the NTLM authentication scheme out + of the box and probably never will. The reasons for that are legal rather than + technical. However, NTLM authentication can be enabled by using an external + NTLM engine such as JCIFS + library developed by the Samba + project as a part of their Windows interoperability suite of programs. For details + please refer to the NTLM_SUPPORT.txt document included with + HttpClient distributions. + +
+ NTLM connection persistence + NTLM authentication scheme is significantly more expensive + in terms of computational overhead and performance impact than the standard + Basic and Digest schemes. This is likely to be + one of the main reasons why Microsoft chose to make NTLM + authentication scheme stateful. That is, once authenticated, the user identity is + associated with that connection for its entire life span. The stateful nature of + NTLM connections makes connection persistence more complex, as + for the obvious reason persistent NTLM connections may not be + re-used by users with a different user identity. The standard connection managers + shipped with HttpClient are fully capable of managing stateful connections. However, + it is critically important that logically related requests within the same session + use the same execution context in order to make them aware of the current user + identity. Otherwise, HttpClient will end up creating a new HTTP connection for each + HTTP request against NTLM protected resources. For detailed + discussion on stateful HTTP connections please refer to + this section. + As NTLM connections are stateful it is generally recommended + to trigger NTLM authentication using a relatively cheap method, + such as GET or HEAD, and re-use the same + connection to execute more expensive methods, especially those enclose a request + entity, such as POST or PUT. + +
+
+
<literal>SPNEGO</literal>/Kerberos Authentication SPNEGO (Simple and