Java 通过windows 的域来验证用户

第一次碰到,记录一下,以备不时之需。

UniAddress thisAddress = UniAddress.getByName(host); //host为IP地址或服务器名称,String
NtlmPasswordAuthentication thisAuth = new NtlmPasswordAuthentication(domain, userID,
                    password);//domain 为windows 的域
SmbSession.logon(thisAddress, thisAuth);//验证成功返回true

猜你喜欢

转载自blog.csdn.net/scanner_new/article/details/84642831