[jcifs] Forwarding after authorization failure using NtlmHttpFilter

Jonathan D Trumbull Jonathan.Trumbull at abbott.com
Sun Mar 13 17:23:54 GMT 2005


Richard,

> You could also obtain the RequestDispatcher during init() and store
> that; so rather than doing getServletContext()... etc. each failed
> login, it would just do:
 
>if (dispatcher != null) dispatcher.forward(request, response);

Yes, that's a little simpler!

> You might be able to use the servlet error-page handling (i.e. declare
> an error page for 401 and see if that works).

I'll give that a try, but I am suspicious for just the reason you mention. 
 But I assume that something like must work otherwise the filter wouldn't 
be as widely used as it is.

Thanks!

--Jonathan





Richard Caper <rcaper at gmail.com>
Sent by: jcifs-bounces+jonathan.trumbull=abbott.com at lists.samba.org
03/12/2005 10:55 PM
Please respond to Richard Caper

 
        To:     Jonathan D Trumbull <Jonathan.Trumbull at abbott.com>
        cc:     jcifs at samba.org
        Subject:        Re: [jcifs] Forwarding after authorization failure using NtlmHttpFilter


> 
> To do this I needed to store a reference to the FilterConfig object 
passed
> in init() but that is about the extent of the 

You could also obtain the RequestDispatcher during init() and store
that; so rather than doing getServletContext()... etc. each failed
login, it would just do:
 
if (dispatcher != null) dispatcher.forward(request, response);
 

> missing something.  Does this modification cause any problems or is 
there an
> even simpler solution that I was too dense to see? 
> 

You might be able to use the servlet error-page handling (i.e. declare
an error page for 401 and see if that works).  NTLM is a bit weird
though, since the server will send a 401 with the challenge as well as
the authentication result; so the error page may trap that
intermediate response and hiccup the NTLM handshake.


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


More information about the jcifs mailing list