[jcifs] Re: jcifs & Tomcat & Struts

Alfie Kirkpatrick Alfie.Kirkpatrick at ioko.com
Thu Dec 18 17:23:51 GMT 2003


The filter wraps the HttpServletRequest and provides an override for the
getRemoteUser method, so you can just call getRemoteUser() in your
servlet. An example is given in the distribution (in
/examples/NtlmHttpAuthExample.java). You can also call
getUserPrincipal() which is actually an instance of
NtlmPasswordAuthentication, from which you could get the domain if
needed.

The NtlmPasswordAuthentication object is also stored in the user's
session under key "NtlmHttpAuth".

Hope it helps... I'm having trouble getting this to work on an AD domain
(which is why I know the code so well!), so if you are using AD would
appreciate if you could send me your config.

Regards, Alfie.

-- Original Message --

Hi there, I was very impressed to stumble across jcifs. I was so
excited, I
did a little dance.

I have configured Tomcat with the jcifs.http.NtlmHttpFilter, and it is
working beautifully.
However, my knowledge of Tomcat 'filters' is not extensive. I have
search
for further info on this, but maybe it's just best to ask.

What I want to do:
*	NTLM Authentication via the filter.
*	Pass details in to our existing security model (create sessions
roles etc) - note we do not sue the Tomcat Security stuff.
*	Page is then executed using the Struts Action Servlet.

Can some one give me some pointers on how I get user information
(username
etc) that was checked during the filter phase so it can be used in our
Struts Security plug in.

Maybe I'll say that again: How do I access any objects created in
Filters
into something running in a following Servlet context?

Thanks in advance for any assistance you can provide.


More information about the jcifs mailing list