我想验证/验证type3message
服务器从客户端浏览器收到的Apache httpd
并传递给Apache Tomcat
。我只是无法弄清楚如何去做。
我有here描述的以下机制。 C
是客户。 S1
是Apache httpd
服务器,S2
是Apache Tomcat
服务器。
1. C -> S1 GET ...
2. S1 -> C 401 Unauthorized
WWW-Authenticate: NTLM
3. C -> S1 GET ... (type 1 message)
Authorization: NTLM TlRMTVNTUAABAAAAA7IAAAoACgApAAAACQAJACAAAABMSUdIVENJVFlVUlNBLU1JTk9S
4. S1 -> C 401 Unauthorized (type 2 message)
WWW-Authenticate: NTLM TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==
5. C -> S1 GET ... (type 3 message)
Authorization: NTLM TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT
6. S1 -> S2 Challenge - TlRMTVNTUAACAAAAAAAAACgAAAABggAAU3J2Tm9uY2UAAAAAAAAAAA==
Token - TlRMTVNTUAADAAAAGAAYAHIAAAAYABgAigAAABQAFABAAAAADAAMAFQAAAASABIAYAAAAAAAAACiAAAAAYIAAFUAUgBTAEEALQBNAEkATgBPAFIAWgBhAHAAaABvAGQATABJAEcASABUAEMASQBUAFkArYfKbe/jRoW5xDxHeoxC1gBmfWiS5+iX4OAN4xBKG/IFPwfH3agtPEia6YnhsADT
7. S2 -> S1 Authenticated or Not Authenticated
8. S1 -> C 200 Ok or 401 Unauhorized
在Apache Tomcat
服务器中,我想验证用户身份。我在步骤4中向客户端发送了challenge/type2message
Apache httpd
服务器,在第5步中客户端响应了type3message
。
我正在做以下事情,但是,我得到了一个例外。我缺少一些基本的东西,如设置配置和/或环境,但由于某种原因,我的大脑拒绝工作。
NtlmPasswordAuthentication np = new NtlmPasswordAuthentication(t3m.getDomain(), t3m.getUser(), serverChallenge, t3m.getLMResponse(), t3m.getNTResponse());
InetAddress ia = InetAddress.getByName("domain");
UniAddress ua = new UniAddress(ia);
SmbSession.logon(ua, np); // exception is here
我做得对吗?我想验证用户身份。