[jcifs] jcifs loses post parameters

Abhijeet Sarwate abhijeet.sarwate at gmail.com
Tue Jan 24 15:22:27 GMT 2006


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