[jcifs] NTML and dynamic domain controller

Enrico enrico.liboni at virgilio.it
Fri Sep 7 17:49:39 GMT 2007


I've tried to extend NtlmHttpFilter in order to have the Domain 
Controller value sourced *not* from the filter params in the web.xml, 
but from a variable set at runtime. Goal is to do not have to change 
the web.xml when deploying the war file (I'd like this in art.sf.net).

I wanted to simply create a new filter in my package that extends jcifs.
http.NtlmHttpFilter by rewriting init() or  doFilter method in order to 
update the domainController variable; but of course this does not work 
(domainController is private in the super class).

Creating a new class 
in my package, by almost copying the NtlmHttpFilter class would not 
work, since it refers to NtlmHttpServletRequest that is not public - i.
e. I should recreate also NtlmHttpServletRequest in my packge.

Thus 
the workaround has been to create a new filter in jcifs.http package... 
but I wander how you would have done this. 
Any better idea or 
suggestion?

Thx,
 Enrico

http://art.sourceforge.net


----Messaggio 
originale----
Da: enrico.liboni at virgilio.it
Data: 27-ago-2007 6.06 PM
A: <jcifs at lists.samba.org>
Ogg: R: RE: [jcifs] NTML and dynamic domain 
controller

Scott, thanks for the hint - I had a look and indeed in 
the 
NtlmHttpFilter.java class, init() method the values are always 
obtained 
from the filter init-param, overriding the ones passed via -
Djcifs.
name=value or using Config.setProperty(...). 

I'm not sure 
this is the 
best option in all cases when a portable war file is 
needed...

Enrico



 


----Messaggio originale----
Da: SCHRIST1 at amfam.
com
Data: 27-ago-
2007 2.30 PM
A: <jcifs at lists.samba.org>
Ogg: RE: 
[jcifs] NTML and 
dynamic domain controller

Extend the NTLM filter to 
read the property 
from the System properties
and store it in the jcifs.
http.
domainController jCIFS property (I think
the jcifs.Config object 
will 
let you do this).  The NTLM filter is
really just an example of 
how to 
use jCIFS, not a hard and steadfast
rule.

Thanks,
Scott

-----
Original 
Message-----
From: jcifs-bounces+schrist1=amfam.com at lists.
samba.org
[mailto:jcifs-bounces+schrist1=amfam.com at lists.samba.org] On 
Behalf Of
eliboni at gmail.com
Sent: Sunday, August 26, 2007 12:50 PM
To: 
jcifs at lists.samba.org
Subject: [jcifs] NTML and dynamic domain 
controller

Hi,
 I've been looking through the mailing list and tried 
this for 
days... pls. help!

I'd need NTML authentication in a web 
application, 
but I do not want to specify any static IP address or 
domain name in 
the web.xml: I would like to store jcifs.http.
domainController value in 
a props file, set the value via System.
setProperties() when the web 
application fires up (i.e. setting it 
from a servlet that is invoked at 
startup). 

But it does not work, 
the filter is complaining about:
jcifs.smb.SmbException: A domain was 
not specified
if the jcifs.http.
domainController params is not in the 
web.xml.
While if I specify it in 
the web.xml I can't override the 
value...

I'm using jcifs 1.2.17

Any 
idea?

Thanks in advance,
Enrico








More information about the jcifs mailing list