如何获取 Kerberos TGS 并在 Java 的 GUI 应用程序中使用它?
我正在尝试使用 Java 中的 Keberos 协议和 GSS-API 制作一个应用程序,并且在调用 doAsPrivileged 方法之前我已经进行了身份验证和上下文建立。 在这种方法中,我获得了从客户端向服务器发送一个简单令牌的相互身份验证,但之后我想做一些其他事情。
我想打开一个带有产品表的新窗口,让客户端选择它们并购买一些东西,并且该窗口已连接到服务器中的数据库。
我的问题是关于 ai 如何在与原始 doAsPrivileged 操作类不同的其他框架中使用此上下文。
我收到错误 GSSException:未提供有效凭据(机制级别:无法找到任何 Kerberos tgt),并且我不知道如何找到此 TGT 以将其多次发送到服务器。
谢谢。
i'm trying to make an application with the Keberos protocol and the GSS-API in Java, and i've already made the authentication and the context establishement before calling the doAsPrivileged method.
In this method I get the mutual authentication sending a simple token from the client to the server, but after that i want to make some other things.
I want to open a new window with a table of products to let the client select them and buy something and that was connected to a database in the server.
my question is about how can a i use this context in other frames that are diferent from the original doAsPrivileged action class.
i get an error GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt) and i don't know how can i find this TGT to send it more than one time to the server.
thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我也遇到了类似的问题。
您的代码失败,因为 Java 尝试使用带有默认登录配置名称的 GSSAPI。这是
com.sun.security.jgss.initiate
。要为其他人或使用另一个登录配置名称执行 GSS 调用,您必须使用LoginContext
,获取主题,然后执行doAs
。据我所知,如果您不坚持默认值,则涉及票证交换的每个操作都必须在PrivilegedAction
中完成。这就是我们的东西失败的原因:-(I ran into a similar issue as well.
Your code fails because Java tries to use GSSAPI with the default login config name. Which is
com.sun.security.jgss.initiate
. To perform a GSS call for someone else or with another login conf name you have to use theLoginContext
, obtain the subject and then do adoAs
. As far as I can see, every action involving ticket exchange has to be done in aPrivilegedAction
if you don't stick to the defaults. That's why our stuff's failing :-(