spring-security-kerberos 无法读取密钥表?
我正在尝试遵循 这个 spring-security-kerberos 教程 我有一个包含一个主体的密钥表:
ktutil: rkt http-web.keytab
ktutil: l
slot KVNO Principal
---- ---- ---------------------------------------------------------------------
1 3 HTTP/[email protected]
此密钥表是使用以下命令在 win 2k8 域控制器上生成的:
ktpass /out http-web.keytab /mapuser [电子邮件受保护] /princ HTTP/[email protected] /pass *
已通过 spnego.xml 中使用的测试 Web 服务器复制:
<bean class="org.springframework.security.extensions.kerberos.SunJaasKerberosTicketValidator">
<property name="servicePrincipal" value="HTTP/[email protected]" />
<property name="keyTabLocation" value="/WEB-INF/http-web.keytab" />
<property name="debug" value="true" />
</bean>
找到校长:
Key for the principal HTTP/[email protected] not available in
jndi:/localhost/spring-security-kerberos-sample-1.0.0.CI-SNAPSHOT/WEB-INF/http-web.keytab
[Krb5LoginModule] authentication failed
Unable to obtain password from user
我已经尝试过了将 Web 服务器(Centos 5.5、tomcat6)加入 AD WAD.ENG.HYTRUST.COM,并可以使用 AD 凭据登录,然后使用 /etc/krb5.keytab 中的主体来查看它是否可以读取...相同回复。我还尝试了很多大写和小写名称的变体。
ps今天早上从git上查了一下。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有几个错误导致“无法从用户获取密码”:
指出);它应该是这样的
classpath:http-web.keytab
或file:c:/http-web.keytabl
与实际生成的密钥表文件不匹配)
已修复),- 在 SPRING SECURITY KERBEROS/SPNEGO EXTENSION< 的评论中看到投诉/a> SpringSource 博客文章,并收到了有关我的开发环境 - Windows 7 / Java 6 的证据 - 必须始终考虑绝对路径(即使类路径引用的 keytab 没有空格)
There're several mistakes that lead to "Unable to obtain password from user":
pointed out); it should be something like
classpath:http-web.keytab
orfile:c:/http-web.keytabl
doesn't match the actual one, for which keytab file was generated)
fixed),- saw complaints in comments on SPRING SECURITY KERBEROS/SPNEGO EXTENSION SpringSource blog entry, and received evidence on my dev environment - Windows 7 / Java 6,- the absolute path must be considered at all times (even if keytab referenced by classpath with no spaces)
我有完全相同的问题。
问题是您的“keyTabLocation”设置。
您不能将其设置为 /WEB-INF/http-web.keytab
您需要将其设置为文件路径或类路径上的某些内容。
例如,我将文件放在类路径上并进行以下设置:
I had the exact same issue.
The problem is your "keyTabLocation" setting.
You cannot set it to /WEB-INF/http-web.keytab
You need to set it to something on the file path or classpath.
For instance, I put my file on the classpath and made this setting:
我们只是偶然发现尝试使用 SASL+Kerberos 客户端尝试对 Kafka 代理进行身份验证时出现此错误。问题是他们的 JVM 不支持高级加密密码,因此无法从密钥表中读取密钥并被默默地忽略。
解决方案是升级他们的 Java 版本,因为现代 >= Java8 版本支持 AES256 和其他更高级的密码。
我们使用以下 Java 代码来测试 AES:
We just stumbled over this error when trying to work with a SASL+Kerberos client trying to authenticate against Kafka brokers. The problem was that their JVM did not support advanced encryption ciphers so the key could not be read from the keytab and was silently ignored.
The solution was to upgrade their Java version since modern >= Java8 versions support AES256 and other more advanced ciphers.
We used the following Java code to test for AES: