jcifs的NTLMHTTP验证及所犯错误


一、错误提示:0xC0000022: jcifs.smb.SmbAuthException: Access is denied

The NTLM HTTP SSO Filter that used to be included withJCIFS cannot support NTLMv2.

1) jcifs.smb.lmCompatibility = 0 or 1: SendLM and NTLM
2) jcifs.smb.lmCompatibility = 2: Send NTLM in both fields
3) jcifs.smb.lmCompatibility = 3, 4, or 5: Send just LMv2

1、使用包:jcifs-1.3.14.jar

2、Eclipse的web工程中的web.xml配置:下面黑体配置,解决了错误。

<?xml version="1.0"encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID"version="2.5">
<display-name>ITSystemSSO</display-name>

<filter>
<filter-name>WebServicesFilter</filter-name>
<filter-class>com.channelsoft.sso.ipfilter.IpFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>WebServicesFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>


<filter>
<filter-name>NtlmHttpFilter</filter-name>
<filter-class>jcifs.http.NtlmHttpFilter</filter-class>
<init-param>
<param-name>jcifs.http.domainController</param-name>
<param-value>10.130.1.9</param-value>
</init-param>
<init-param>
<param-name>jcifs.smb.lmCompatibility</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>jcifs.smb.client.useExtenededSecurity</param-name>
<param-value>false</param-value>
</init-param
>
<init-param>
<param-name>jcifs.smb.client.soTimeout</param-name>
<param-value>35000</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>NtlmHttpFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>DenyFilter</filter-name>
<filter-class>com.channelsoft.sso.deny.DenyAll</filter-class>
</filter>
<filter-mapping>
<filter-name>DenyFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>

3、说明

http://lists.samba.org/archive/jcifs/2004-February/003069.html

http://www.ioplex.com/d/jespa/api/jespa/ntlm/NtlmSecurityProvider.html

二、错误提示:jcifs.smb.SmbException: NTLMv2 requires extendedsecurity (jcifs.smb.client.useExtendedSecurity must be true ifjcifs.smb.lmCompatibility >= 3)

如果已经增加了上面黑体部分,则需重启tomcat服务器。

三、调试java web程序,时替换jar包,旧jar包修改名称后继续保存在\WebContent\WEB-INF\lib文件夹下,加载旧包,而没有重新加载新包。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值