我尝试测试我的 in-ms-domain 应用程序。应用服务器已成功部署。kerberos 和用户名/密码,身份验证都很好。
但是当我使用由“ktpass”客户端密钥表生成的“KerberosRestTemplate”添加“测试”(它是控制器的原因)时,“SunJaasKerberosTicketValidator”抛出异常:
' java.security.PrivilegedActionException:GSSException:在 GSS-API 级别未指定失败(机制级别:指定的密钥版本不可用(44)) '。
我建议的原因是 ktpass 生成的 keytab 文件被破坏了。这就是我生成它的方式:
"C:> ktpass /princ deniz@TESTAD.LOCAL /pass Qw1er2ty3 /ptype KRB5_NT_PRINCIPAL /out deniz.keytab
*NOTE: creating a keytab but not mapping principal to any user.
For the account to work within a Windows domain, the
principal must be mapped to an account, either at the
domain level (with /mapuser) or locally (using ksetup)
If you intend to map deniz@TESTAD.LOCAL to an account through other means
or don't need to map the user, this message can safely be ignored.
WARNING: pType and account type do not match. This might cause problems.
Key created.
Output keytab to deniz.keytab:
Keytab version: 0x502
keysize 52 deniz@TESTAD.LOCAL ptype 1 (KRB5_NT_PRINCIPAL) vno 1 etype 0x17 (RC4-HMAC) keylength 16 (0xa0eb0b1e09b8c36edc
2da4762c53283f)*"
以防万一我在我的 github 上保存了示例:https ://github.com/mezlogo/kerberos_sample
我认为 keytab 我的 keytab 坏了,但找不到如何生成它以供客户端使用(没有 HTTP/username@DOMAIN)。
PS对不起我的英语。