为 spring-security-kerberos-client 生成 MS AD 密钥表



我尝试测试我的域内应用程序。应用服务器已成功部署。Kerberos和用户名/密码,身份验证效果很好。

但是当我使用"KerberosRestTemplate"和"ktpass"客户端密钥表生成的"测试"(有一些原因为什么它是控制器(时,"SunJaasKerberosTicketValidator"抛出了异常:

'java.security.PrivilegedActionException: GSSException: 在 GSS-API 级别未指定的故障(机制级别:指定的密钥版本不可用 (44(("。

我建议原因是 ktpass 生成的密钥表文件被破坏了。这就是我生成它的方式:

"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

我认为密钥表我的密钥表坏了,但找不到如何为客户端使用生成它(没有 HTTP/username@DOMAIN(。

附言对不起我的英语。

每当运行 ktpass 时,AD 都会将存储在 AD 中的版本号递增 1。因此,在运行 ktpass 之前,您需要查看实际值,并使用/kvno 选项 (https://technet.microsoft.com/en-us/library/cc753771.aspx( 指定此值递增 1,以便存储在 AD 中的密钥版本号和密钥表文件中的密钥版本号相同。

相关内容

最新更新