[jcifs] JCIFS with Windows Vista / IE 7

Michael B Allen ioplex at gmail.com
Wed Jan 7 01:25:06 GMT 2009


As described in the following post, the JCIFS NTLM HTTP Filter does
not support NTLMv2 and never will:

  http://lists.samba.org/archive/jcifs/2008-October/008227.html

So regarding your error, when using the Filter, make sure
jcifs.smb.lmCompatibility = 0 and
jcifs.smb.client.useExtenededSecurity = false so that only NTLMv1 is
used without extended security.

Mike

On Tue, Jan 6, 2009 at 7:50 PM, shibaram <dunumania at yahoo.co.in> wrote:
>
> For the meanwhile to test my application I set up the properties in the
> web.xml itself and managed to run the application for once or twice.
> But now I am facing a new error as below:
>
> jcifs.smb.SmbException: NTLMv2 requires extended security
> (jcifs.smb.client.useExtendedSecurity must be true if
> jcifs.smb.lmCompatibility >= 3)
>        at
> jcifs.smb.NtlmPasswordAuthentication.getSigningKey(NtlmPasswordAuthentication.java:473)
>        at jcifs.smb.SmbSession.sessionSetup(SmbSession.java:295)
>        at jcifs.smb.SmbSession.send(SmbSession.java:234)
>        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:161)
>        at jcifs.smb.SmbSession.logon(SmbSession.java:170)
>        at jcifs.smb.SmbSession.logon(SmbSession.java:163)
>        at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:189)
>        at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:121)
>        at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>
>
> As the message shows "jcifs.smb.lmCompatibility >= 3"
> So I set up in the web.xml filter init-param to set
> jcifs.smb.lmCompatibility to 3.
> Still its not working.
>
> I am using Windows Vista with IE 7 browser.
> In mozilla no doubt I am getting the login modal window and although I pass
> correct windows login and password, authentication fails repeatedly.
>
> What could be the possible solution above?
>
> Thanks
> Shibaram
>
>
> Michael B Allen wrote:
>>
>> On Tue, Jan 6, 2009 at 5:34 PM, shibaram <dunumania at yahoo.co.in> wrote:
>>>
>>> Thanks Mike, Chuck and John.
>>>
>>> @ John,
>>> No, its not like that.
>>> using the 1.3.1 jar file and  directly setting the properties in the
>>> web.xml
>>> under <filter> under <init-param>   I am able to run everything fine even
>>> in
>>> eclipse development phase.
>>> This is only breaking when I try to read the properties from an external
>>> property file.
>>>
>>> @ Mike:
>>> I am setting the property as said by Mike like below:
>>>
>>> -Djcifs.properties=<System Full Path>\jcifs.properties
>>> e.g. (in my case) :
>>> -Djcifs.properties=C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
>>> in the server (Tomcat here) as command line setting.
>>>
>>> And now in Development phase in Eclipse IDE , when I access the property
>>> in
>>> my custom Ntlmfilter
>>> like below:
>>>
>>> public class NtlmCustomisedHttpFilter extends NtlmHttpFilter {
>>>
>>>     public void init( FilterConfig filterConfig ) throws ServletException
>>> {
>>>
>>>         String justGet = System.getProperty("jcifs.properties");
>>>
>>>         String propFile =
>>> filterConfig.getInitParameter("jcifs.properties");
>>>  //        Config.setProperty("jcifs.properties", propFile);
>>>
>>>
>>> System.out.println("-----------========================----------------------");
>>>         System.out.println("justGet = "+justGet);
>>>         System.err.println("Path of property file = "+propFile);
>>>         System.err.println(Config.getProperty("jcifs.netbios.wins",
>>> null));
>>>         System.err.println(Config.getProperty("jcifs.smb.client.domain",
>>> null));
>>>
>>> System.out.println("-----------========================----------------------");
>>>         super.init(filterConfig);
>>>     }
>>> }
>>>
>>> I am getting below outputs from above in the eclipse consol :
>>>
>>> INFO: Starting Servlet Engine: Apache Tomcat/6.0.18
>>> -----------========================----------------------
>>> justGet = null
>>> Path of property file =
>>> C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
>>> null
>>> null
>>> -----------========================----------------------
>>> Jan 6, 2009 5:28:14 PM org.apache.coyote.http11.Http11AprProtocol start
>>> INFO: Starting Coyote HTTP/1.1 on http-8080
>>> Jan 6, 2009 5:28:14 PM org.apache.coyote.ajp.AjpAprProtocol start
>>> INFO: Starting Coyote AJP/1.3 on ajp-8009
>>> Jan 6, 2009 5:28:14 PM org.apache.catalina.startup.Catalina start
>>> INFO: Server startup in 397 ms
>>> Jan 6, 2009 5:28:15 PM org.apache.catalina.core.StandardWrapperValve
>>> invoke
>>> SEVERE: Servlet.service() for servlet default threw exception
>>> jcifs.smb.SmbException: A domain was not specified
>>>        at jcifs.smb.SmbSession.getChallengeForDomain(SmbSession.java:90)
>>>        at jcifs.http.NtlmHttpFilter.negotiate(NtlmHttpFilter.java:157)
>>>        at jcifs.http.NtlmHttpFilter.doFilter(NtlmHttpFilter.java:121)
>>>        at
>>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>>>        at
>>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>>>
>>>
>>> As you can see when I launch the tomcat within the eclipse ide and test
>>> the
>>> application.
>>> still I get a Null   for  System.getProperty("jcifs.properties").
>>>
>>> BUT, if I deploy the application as a war file and launching the Tomcat
>>> out
>>> side eclipse and access the application, it executes fine without error.
>>> Means in this case System.getProperty("jcifs.properties")   manages to
>>> read
>>> from the
>>> -Djcifs.properties=C:\Workspace_Eclipse33_SBC\JCIFS\WebContent\WEB-INF\opt\jcifs.properties
>>> from the command line proerty set in the tomcat server.
>>>
>>> But in the former case (Launching the application Run/ Debug mode in
>>> Eclipse
>>> with Tomcat), System.getProperty("jcifs.properties") does not read the
>>> settings by default.
>>>
>>> I looked up some help in Eclipse itself, and found that (probably) we
>>> need
>>> to pass the system settings in the "eclipse.ini" file as
>>> -Djcifs.properties=<System Full Path>\jcifs.properties
>>
>> Yes. If you are running through an IDE then the tomcat command-line
>> options will not apply. You must then modify the command-line of the
>> program loading the JCIFS classes. Thus in the case of Eclipse you
>> must modify *it's* command-line (however that's done I don't know - I
>> don't use an IDE).
>>
>> Mike
>>
>> --
>> Michael B Allen
>> PHP Active Directory SPNEGO SSO
>> http://www.ioplex.com/
>>
>>
>
> --
> View this message in context: http://www.nabble.com/JCIFS-with-Windows-Vista---IE-7-tp6057570p21322805.html
> Sent from the Samba - jcifs mailing list archive at Nabble.com.
>
>



-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list