[jcifs] (no subject)

eglass1 at comcast.net eglass1 at comcast.net
Wed Feb 18 12:12:10 GMT 2004


Do you have a filter-mapping element as well?  Basically, you should have the
filter definition (which you've got below); then an additional filter-mapping,
i.e.:

<filter-mapping>
    <filter-name>NTLM HTTP Authentication Filter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

The above would map the filter to all URIs in the web application.

If that doesn't work, you may have a classpath-related issue; I typically find
it's easiest to put the jCIFS .jar file in the WEB-INF/lib subdirectory of the
web app itself (rather than trying to install globally) as this prevents issues
with classloading order.  A good test would be to set up an example .jsp in
your web app, with the following in it:

  <%= Class.forName("jcifs.http.NtlmHttpFilter") %>

When you access the .jsp from your browser you'll get errors if your web app
can't find the filter (which it should be able to).

If that doesn't give errors (i.e., the filter class is visible but doesn't
appear to be working) try adding the following to your test .jsp:

  <%= request.getClass().getName() %>

This should print jcifs.http.NtlmHttpServletRequest; if it does, and the
username is still not appearing in getRemoteUser(), then it's a jCIFS issue.
If you get a different class name, then the filter isn't being installed by
the container.  Try checking the logs, and see if anything is being flagged.


Eric
> Hi Eric
> 
> Thank you so much for your prompt response..
> 
> I've read through the documentation on jCIFS NTLM HTTP Authentication and
> the Network Explorer Servlet that ask to implement the filter you just
> mentioned.
> I've added the following into the web.xml as instructed
> <filter>
>         <filter-name>NTLM HTTP Authentication Filter</filter-name>
>         <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
> 
> <!-- For development, any SMB server is suitable for validating
>      password hashes.
> -->
>         <init-param>
>             <param-name>jcifs.http.domainController</param-name>
>             <!-- <param-value>192.168.1.16</param-value> This was changed to
> my own machine IP address-->
>             <param-value>192.168.1.160</param-value>
> 
>         </init-param>
> 
> 
>     </filter>
> 
> 
> but however, after many attempts, still fail to get a value from
> request.getRemoteUser().
> From the installation guide,
> 
> "If the NTLM HTTP Authentication Filter is not enabled something like the
> following will be displayed: null successfully logged in "
> 
> how was it supposed to be enabled?
> how can i resolve this? any suggestions is welcome :-)
> 
> thanks in advance
> 
> ----- Original Message -----
> From: "Eric" <eglass1 at comcast.net>
> To: "Juliana" <juliana at relevanz.com>
> Cc: <jcifs at lists.samba.org>
> Sent: Wednesday, February 18, 2004 5:12 PM
> Subject: Re: [jcifs] (no subject)
> 
> 
> > This is the wrong JCIFS, apparently; a Google on CifsSessionManager
> > turns up Norbert Hranitzky's package:
> >
> >      http://www.norbert.hranitzky.com/jcifs/jcifs.htm
> >
> > Not familiar with that really, but it looks like an option might be
> > (our) NtlmHttpFilter; this provides NTLM authentication for servlets,
> > and gives you the remote username in getRemoteUser().
> >
> > It looks like the approach you're taking (currently) is:
> >
> > 1) Client makes an anonymous connection to the servlet.
> > 2) Servlet connects back to the client.
> > 3) Servlet performs RAP calls to get the workstation and user
> > information from the client.
> >
> > Again, I'm not familiar with the package so I can't give too much
> > clarifying information.  It may be that the client workstation requires
> > a specific privilege level to return the logged on username over RAP (a
> > lot of the RAP calls require local admin on the target box).
> >
> >
> > Eric
> >
> > Juliana wrote:
> > > Hi
> > >
> > > I have an issue regarding the retrival of user name from workstation.
> > > My main purpose is to use the user name to perform a check of whether
> > > the user is part of the Active Directory so that
> > > a single signon can be performed to access the intranet system.
> > >
> > > here is my scenerio:
> > >
> > >
> > > logged on client                             application server
> > > |
> > >     |
> > > |-------------------------send request(url)------------------------> |
> > > (server activate servlet, get request host and
> > > |
> > >     | performs a CifsSessionManager.connectRemoteAdmin(sessionName,
> host)
> > > | <----------------------connectRemoteAdmin()-----------------|
> > > |
> > > |
> > > | <-------------CifsRemoteAdmin.getWorkstationInfo()--- |
> > > | <-------------CifsRemoteAdmin.getUserName()-----------| (returns me an
> > > empty string here.)
> > > |
> > >         |
> > >
> > >
> > > after which the server connects successfully to the client, i do a
> > > CifsRemoteAdmin.getWorkstationInfo() to retrieve the
> > > workstation information as well as the logged on username (by invoking
> > > the CifsWorkstationInfo.getUserName())
> > >
> > > though i was able to get the logon domain and workstation name, the
> > > value returned to me after invoking the getUserName() is an empty
> string.
> > >
> > > May I know if there are any walk around or other solution to this? or
> > > how can i get the logon username of the client anyway?
> >
> >
> 
> 


More information about the jcifs mailing list