Java中的Kerberos身份验证 - 确实是“登录” java中的动作等于“kinit”? [英] Kerberos Authentication in Java - does "login" action in java equals to "kinit"?

查看:1228
本文介绍了Java中的Kerberos身份验证 - 确实是“登录” java中的动作等于“kinit”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Java中使用GSSAPI以使用Kerberos身份验证登录LDAP服务器。我是Kerberos的新手,所以如果这是一个显而易见的问题我很抱歉,但我在网上找不到任何清楚的东西。

I'm using GSSAPI in Java in order to login to an LDAP server using Kerberos authentication. I'm a newbie to Kerberos, so I'm sorry if this is an obvious question, but I couldn't find anything clear enough on the internet.

我执行以下步骤:


  1. 通过设置系统属性定义登录配置java.security.auth.login.config 到配置文件路径。

  2. 使用配置名称调用 LoginContext.login()和自定义的回调处理程序

  3. 如果登录成功,假装成主题(通过使用 Subject.doAs() ),并通过使用适当的环境变量创建一个新的 InitialLDAPContext 来连接到LDAP服务器。

  1. Define Login configuration by setting the system property "java.security.auth.login.config" to the configuration file path.
  2. Call LoginContext.login() with the name of the configuration and a self defined callback handler
  3. In case login succeeded, "pretend to be" the subject (by using Subject.doAs()), and connect to the LDAP server by creating a new InitialLDAPContext with the appropriate environment variables.

现在,我的问题是我不明白哪个步骤与哪个kerberos行动相关?
说登录后我只有TGT是否正确?我什么时候可以获得特定于服务的票?

Now, My problem is I don't understand which step correlates to which kerberos action? Is it correct to say that after the login action I only have a TGT? When do I get the service specific ticket?

谢谢,
Dikla

Thanks, Dikla

推荐答案


类com.sun.security.auth.module.Krb5LoginModule是Sun针对Kerberos版本5协议的登录模块的实现。成功验证后,票证授予票证(TGT)存储在Subject的私有凭证集中,Kerberos主体存储在Subject的主体集中。

The class com.sun.security.auth.module.Krb5LoginModule is Sun's implementation of a login module for the Kerberos version 5 protocol. Upon successful authentication the Ticket Granting Ticket (TGT) is stored in the Subject's private credentials set and the Kerberos principal is stored in the Subject's principal set.

(取自此处

这意味着 LoginContext.login 确实等于 kinit 之后,我们有一个TGT。

This means that LoginContext.login is indeed equal to kinit in that after each of them, we have a TGT.

服务票据将被获取并在以后使用 - 根据<$中执行的操作c $ c> Subject.doAs()。

The service ticket will be obtained and used later - according to the action performed in Subject.doAs().

这篇关于Java中的Kerberos身份验证 - 确实是“登录” java中的动作等于“kinit”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆