我正在尝试使用 spnego 和 tomcat 设置 Kerberos 集成 Windows 身份验证。
这是我第一次这样做,还没有看到真正的环境,所以主要依赖于 spnego 站点的在线文档。我收到以下错误:
GSSException:在 GSS-API 级别未指定故障(机制级别:无效参数(400)找不到适当类型的密钥来解密 AP REP - RC4 与 HMAC)
Catalina log shows:
Jan 30, 2017 10:12:37 AM net.sourceforge.spnego.SpnegoHttpFilter doFilter
SEVERE: HTTP Authorization Header=Negotiate <edited - actual had a big key>
Jan 30, 2017 10:41:24 AM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-8443"]
Jan 30, 2017 10:41:24 AM org.apache.coyote.AbstractProtocol pause
附加我的 krb5 和 login.conf。
KLIST command gives 2 keys:
CLIENT: B1GYZDM @ test.win.org
Server: krbtgt/test.win.org @ test.win.org
KerbTicket Encryption Type: RSADSI RC4-HMAC(NT)
CLIENT: B1GYZDM @ test.win.org
Server: krbtgt/test.win.org @ test.win.org
KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96
Tomcat 作为本地服务运行。并且 keytab 支持 128 和 256 加密。
你能帮我解决这个问题吗?
KRB5.conf:
[libdefaults]
default_tkt_enctypes = aes128-cts aes256-cts
default_tgs_enctypes = aes128-cts aes256-cts
permitted_enctypes = aes128-cts aes256-cts
[realms]
test.win.org = {
kdc = test.win.org
default_domain = test.win.org
}
[domain_realm]
test.win.org = test.win.org
login.conf:
spnego-client {
com.sun.security.auth.module.Krb5LoginModule required;
};
spnego-server {
com.sun.security.auth.module.Krb5LoginModule required
storeKey=true
useKeyTab=true
keyTab="file:///E:/Apps/apache-tomcat-7.0.40/bin/test.keytab"
isInitiator=false;
};
custom-client {
com.sun.security.auth.module.Krb5LoginModule required
storeKey=true
useKeyTab=true
keyTab="file:///E:/Apps/apache-tomcat-7.0.40/bin/test.keytab"
principal=B1ADPST000;
};