gpt4 book ai didi

spring - 为 spring-security-kerberos-client 生成 MS AD keytab

转载 作者:行者123 更新时间:2023-11-28 20:08:18 27 4
gpt4 key购买 nike

我尝试测试我的 in-ms-domain 应用程序。应用服务器部署成功。 kerberos 和用户名/密码,身份验证都运行良好。

但是当我使用“Ktpass”客户端 key 表生成的“KerberosRestTemplate”添加“测试”(它是 Controller 的某些原因)时,然后“SunJaasKerberosTicketValidator”抛出异常:

'java.security.PrivilegedActionException: GSSException: Failure unspecified at GSS-API level (Mechanism level: Specified version of key is not available (44))'。

我认为原因是 ktpass 生成的 key 表文件被破坏了。这就是我生成它的方式:

"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)。

附言对不起我的英语。

最佳答案

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

关于spring - 为 spring-security-kerberos-client 生成 MS AD keytab,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35181713/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com