[jcifs] Getting domain info from one server to another

Diego Seoane dseoane78 at gmail.com
Wed Jun 3 20:41:16 GMT 2009


Hi everybody!
(first of all, i'd like to beg your pardon for my bad english)....sorry :S.

I am using last jcifs library, after going round and round, googling for
some solution to solve my problem.
My actual situation is that i need, from a Java application (a servlet
maybe), to catch the domain of the user that mades the request to my app,
when this user comes from a domain that is different from the domain where
my app is published.

I mean, if my app is in a tomcat on a domain "A", and someone logs in my app
coming from an account that is loged on a domain "B", i need to know that
the domain of that user is "B". The real problem comes when the users can
log in a Citrix shared desktop, and connect my app from that shared desktop
(or, i don't know..let's say that is a proxy in the middle of all this...).
Then the domain i need to catch is the domain of the Citrix sessión (not a
big problem, i suppose, if the differents domains represents no problem to
jcifs), or the domain that the user logged in before going throuhg that
proxy...

I've tried the aproximation with NTML like:

NtlmPasswordAuthentication ntlm =
                      (NtlmPasswordAuthentication)
          request.getAttribute("NtlmHttpAuth");

             Debug.println("Request: " +
request.getAttribute("NtlmHttpAuth").toString(),"");
             String domain2 = ntlm.getDomain().toString();

..but everytime i try that, ntlm is null (no values returned at all). ¿¿What
am i doing wrong?? My web.xml is basic (really i don't care to autenticate
on a domain, the only thing i want is to get the name of the domain from the
caller, even if it's not in mine. Obviously, the domains had a trusted
relation between both, and the machines are visible from one another). It
goes like this:

 <filter>
    <filter-name>NtlmHttpFilter</filter-name>
    <filter-class>jcifs.http.NtlmHttpFilter</filter-class>
    <init-param>
        <param-name>jcifs.http.domainController</param-name>
        <param-value>192.168.202.129</param-value>
    </init-param>

</filter>
<filter-mapping>
    <filter-name>NtlmHttpFilter</filter-name>
    <url-pattern>/*</url-pattern>
</filter-mapping>

Do i really to set up a Wins, a user and a password from the domain, or
something like that only to get what i need?



I've tried another aproximation with PHP, and simply getting the NTML Auth
header of the request, and decripting it, i am finding something near the
solution, but..i need to put this to work on java (due to requirements of
the customer).

Really sorry for the English...i hope that at least i could made myself
understood.

Really appreciate your help. Thank you very much.

Regards,

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


More information about the jcifs mailing list