1

I plan to create a Java EE application in which, obviously, there will be users, groups and rights. As this application is all new, I'll use Java EE 6 and EJB security annotations : @RolesAllowed, @DeclareRoles, ...

In this context, I'm looking for a way to implement simply the users/groups/roles management. So, is there any lib I could plug in my webapp that would allow me to create users, groups and assign them roles ? Or will i have to do all that job by myself ?

EDIT From what I've discovered, this can be achieved using a JDBC Realm. More specifically, using as an example Flexible JDBC Realm, all I have to do is to declare Users/Groups in my application, then bind them to that realm. Am I right ?

4

2 回答 2

0

事实证明,没有真正的 JavaEE 规范:如果 JavaEE 规范涵盖了领域定义,则大多数领域代码都特定于应用程序服务器和底层存储系统。

于 2013-04-08T07:26:16.953 回答
0

也许你可以试试 LDAP 目录(例如 OpenDS)。在 Glassfish 上设置 LDAP JAAS 领域非常容易,然后您可以在外部管理组和用户。如果您不想在数据库中实现它,您可以使用 JDBC 领域并将它们配置为在应用程序的模式上工作。您必须自己管理用户和组,但可以配置提供的 JAAS 模块,您通常不必编写自己的模块。

于 2011-02-21T22:39:53.677 回答