为 spring-security-kerberos-client 生成 MS AD keytab
Generate MS AD keytab for spring-security-kerberos-client
我尝试测试我的 in-ms 域应用程序。
应用服务器部署成功。 kerberos 和 username/password 身份验证都很好。
但是当我使用 'KerberosRestTemplate' 和 'ktpass' 客户端密钥表生成的 'test' 添加 'test'(它是控制器的某些原因)时,然后 '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)。
P.s。对不起我的英语。
每当您 运行 ktpass 时,AD 都会将存储在 AD 中的版本号递增 1。因此在 运行ning ktpass 之前,您需要查看实际值并指定此值递增 1 使用/kvno 选项 (https://technet.microsoft.com/en-us/library/cc753771.aspx) 以便存储在 AD 中的密钥版本号与密钥表文件中的相同。
我尝试测试我的 in-ms 域应用程序。 应用服务器部署成功。 kerberos 和 username/password 身份验证都很好。
但是当我使用 'KerberosRestTemplate' 和 'ktpass' 客户端密钥表生成的 'test' 添加 'test'(它是控制器的某些原因)时,然后 '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)。
P.s。对不起我的英语。
每当您 运行 ktpass 时,AD 都会将存储在 AD 中的版本号递增 1。因此在 运行ning ktpass 之前,您需要查看实际值并指定此值递增 1 使用/kvno 选项 (https://technet.microsoft.com/en-us/library/cc753771.aspx) 以便存储在 AD 中的密钥版本号与密钥表文件中的相同。