diff options
Diffstat (limited to 'java/src')
-rw-r--r-- | java/src/com/memberwebs/httpauth/jetty/JettyHttpAuthenticator.java | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/java/src/com/memberwebs/httpauth/jetty/JettyHttpAuthenticator.java b/java/src/com/memberwebs/httpauth/jetty/JettyHttpAuthenticator.java index 1b89436..0bf826d 100644 --- a/java/src/com/memberwebs/httpauth/jetty/JettyHttpAuthenticator.java +++ b/java/src/com/memberwebs/httpauth/jetty/JettyHttpAuthenticator.java @@ -100,11 +100,25 @@ public class JettyHttpAuthenticator String user = null; + // Build a unique and consistent Connection ID so that NTLM works + Object obj = request.getHttpConnection().getObject(); + if(obj == null) + { + obj = "" + Math.random(); + request.getHttpConnection().setObject(obj); + } + + StringBuffer connid = new StringBuffer(32); + connid.append(obj.toString()); + connid.append(":"); + connid.append(obj.hashCode()); + connid.append(":"); + connid.append(request.getHttpConnection().hashCode()); + try { - // Connection ID is random. This prevents NTLM from working :( - String connid = "" + Math.random(); - user = authenticateRequest(request, response, connid, request.getMethod(), + // Send off to httpauth for authentication + user = authenticateRequest(request, response, connid.toString(), request.getMethod(), request.getURI().toString(), authtypes); } catch(HttpAuthException e) |