Java JEE5 应用程序。具有 Windows 身份验证且不提示输入用户名和密码的客户端

发布于 2024-10-02 05:29:36 字数 292 浏览 0 评论 0 原文

我们有 JAVA JEE5 企业应用程序,由一个 Web 模块和一个在 glassfish 上运行的应用程序客户端组成。

我们需要针对活动目录设置身份验证。我知道为 Web 模块或应用程序客户端模块设置基于 LDAP 的身份验证很容易,但他们要求我们在启动应用程序客户端时从 Windows 登录中获取凭据,并且以某种方式将凭据传播到 ejb像往常一样分层。这不仅包括用户主体,还包括角色。

简而言之,我的问题是:JAAS 能否插入桌面客户端的 Windows 身份验证机制而不提示用户输入用户名和密码?

谢谢, 巴勃罗.

We have JAVA JEE5 enterprise application consisting of a web module and an app client running on glassfish.

We need to set authentication against active directory. I am aware that it is easy to set up LDAP based authentication for a web module or application client module but they are asking us to pick up the credentials from the windows logon when launching the application client and that somehow the credentials get propagated to the ejb tier as usual. This including not only the user principal but also the roles.

In brief, my question is: Can JAAS plug in to the windows authentication mechanism for desktop clients without prompting the user for user name and password?

Thanks,
Pablo.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

八巷 2024-10-09 05:29:36

我不知道细节或 JAAS 兼容性,但我相信 SPNEGO 和/或 集成 Windows 身份验证 就是您正在寻找的东西。

I don't know about the details or JAAS compability but I believe that SPNEGO and/or Integrated Windows Authentication are the things you are looking for.

贵在坚持 2024-10-09 05:29:36

我还没有尝试过,但这里是从浏览器中提取 NTLM 用户名的代码示例:

http://www.rgagnon.com/javadetails/java-0441.html

但是,由于您正在谈论桌面应用程序,您的问题可能是如何从 java 应用程序中获取用户名,因为 NTLM 实际上不参与。

http://www.roseindia.net/java /java-get-example/java-get-windows-username.shtml

基本上您只需使用:System.getProperty("user.name")

更新:

由于需要角色和所有内容,您可能会发现使用 JNI (http://download.oracle.com/javase/6/docs/technotes/guides/jni/)可能是您最好的选择,但是您将此应用程序绑定到 Windows,但听起来无论如何都会如此,因为您可以从 Java 调用 Windows API 函数。

I haven't tried this, but here is a code example of pulling the NTLM username from the browser:

http://www.rgagnon.com/javadetails/java-0441.html

But, since you are talking about a desktop application your question may be how to get the username from within your java application, since NTLM really isn't involved.

http://www.roseindia.net/java/java-get-example/java-get-windows-username.shtml

Basically you would just use: System.getProperty("user.name").

UPDATE:

Since roles and all are needed, you may find that using JNI (http://download.oracle.com/javase/6/docs/technotes/guides/jni/) may be your best bet, but then you are tying this app to Windows, but it sounds like it will be anyway, as you can then call Windows API functions from Java.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文