[jcifs] jcifs loses post parameters

Tapperson Kevin Kevin.Tapperson at hcahealthcare.com
Tue Jan 24 15:36:21 GMT 2006


See:
http://jcifs.samba.org/src/docs/ntlmhttpauth.html#post
<http://jcifs.samba.org/src/docs/ntlmhttpauth.html> 

and:
 
http://article.gmane.org/gmane.network.samba.java/3708/match=ntlmpostfil
ter


________________________________

From: jcifs-bounces+kevin.tapperson=hcahealthcare.com at lists.samba.org
[mailto:jcifs-bounces+kevin.tapperson=hcahealthcare.com at lists.samba.org]
On Behalf Of Abhijeet Sarwate
Sent: Tuesday, January 24, 2006 9:22 AM
To: jcifs at lists.samba.org
Subject: [jcifs] jcifs loses post parameters


I use JCIFS for NTLM authentication in my app in following way :
 
if user is already logged in the domain don't call JCIFS, call next
filter
else
   call JCIFS filter to authenticate user
 
 
Now what happens is, if the user is already authenticated and user has
a request that contains POST data, it still tries to authenticate and
during that process it loses all the POST data. 
 
Here is the code snipppet:
 

     HttpServletRequest req = (HttpServletRequest)request;
        HttpServletResponse resp = (HttpServletResponse)response;
        
        HttpSession session = req.getSession(true);

        NtlmPasswordAuthentication ntlmPrincipal = 
            (NtlmPasswordAuthentication)
session.getAttribute("ntlmPrincipal");        
        
        if (ntlmPrincipal  == null) {
            ntlmPrincipal = negotiate(req, resp, false); 
            if (ntlmPrincipal  == null) {
             LOG.error("Unable to authenticate user....(null): " +
req.getRemoteUser() );
                return;
            }else{
             session.setAttribute ("ntlmPrincipal",ntlmPrincipal);
             LOG.error("authenticated user....: "
+ntlmPrincipal.getUsername() );
            }
        }else{
            LOG.debug("User is already authenticated :" +
ntlmPrincipal.getUsername());
        }
        
        chain.doFilter(new CECHttpServletRequest (req, ntlmPrincipal),
response);
    }

Is this expected ?

-------------- next part --------------
HTML attachment scrubbed and removed


More information about the jcifs mailing list