Java EE 6登录模块 [英] Java EE 6 Login module

查看:217
本文介绍了Java EE 6登录模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的Java EE 6应用程序中添加一个Login模块。

I would like to add a Login module to my Java EE 6 application.

我读过关于JAAS的内容,但我不明白我是如何使用的它。您是否知道我可以使用JAAS和Java EE 6来理解和实现我的登录模块的一些教程或片段?

I've read about JAAS, but I don't understand how I can use it. Do you know some tutorial or snippet that I can use to understand and implement my login module, using JAAS and Java EE 6?

我正在使用glassfish 3.1.2, eclipselink作为JPA实现和MySQL。

I'm using glassfish 3.1.2, eclipselink as JPA implementation and MySQL.

推荐答案

有关登录模块的Glassfish常见问题,但我同意它并不是很深入。
http://glassfish.java.net/javaee5/security/faq .html #gluglogin

The Glassfish FAQ about login module is there, but I agree it's not very deep. http://glassfish.java.net/javaee5/security/faq.html#pluglogin

分享两件事来区分JAAS框架。 领域登录模块。领域或多或少地定义了存储凭证的位置。登录模块或多或少地定义了验证凭证的方式。

Thare two things to distinguish with JAAS framework. The realm and the login module. A realm defines more or less where crendentials are stored. A login module defines more or less how credential are verified.

例如,您可以使用用户名/密码登录模块,该模块使用存储在数据库领域中的凭据。或者,您可以拥有一个使用智能卡身份验证的登录模块,并使用存储在ActiveDirectory中的凭据。

For instance, you might use a username/password login module, that use credentials stored in a database realm. Or you could have a login module that uses smart card authentication, and uses credentials stored in ActiveDirectory.

这就是理论。从FAQ中可以看出,Glassfish登录模块必须扩展 com.sun.appserv.security.AppservPasswordLoginModule ,因此只支持用户名/密码。

That's the theory. From the FAQ, it says that a Glassfish login module must extend com.sun.appserv.security.AppservPasswordLoginModule, so only username/password is supported.

但你可以插入自己的领域,继承 com.sun.appserv.security.AppservRealm 。您可以阅读这篇文章,了解如何定义和配置ActiveDirectory领域。 此处是一篇关于如何创建您的文章的文章自定义领域与Sun App Server(之后成为Glassfish)。我希望这部分没有太大变化。

But you can plug your own realm, that inherits com.sun.appserv.security.AppservRealm. You can read this article to see how to define and configure an ActiveDirectory realm. Here is an article on how to create your custom realm with Sun App Server (what became Glassfish later). I hope this part didn't change much.

这篇关于Java EE 6登录模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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