Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

User managed security in Java EE

I want to protect my JSF pages in a Java EE 6 app.

I want to store users and roles in the DB and have privileged users administer them via a web tool. The privileged users would add users to roles and set certain pages to require certain roles for access.

It seems to me that container managed security won't let me do that. Would JAAS be the way forward?

Any suggestions and links to examples would be appreciated.

like image 851
retrodev Avatar asked Oct 10 '22 11:10

retrodev


1 Answers

The short answer is yes. JAAS will allow you manage security against a database use a LoginModule(many container implementations JBoss offer these pre-canned out of the box) and you can check out this article(http://weblogs.java.net/blog/2006/03/07/repost-using-jaas-jsf) or this book(http://www.java.net/external?url=http://purl.oclc.org/NET/jsfbook/) for more specifics how to authenticate Users and determine authorization parameters with JAAS and JSF.

For your second requirement, I can't see any reason why you can then create a separate tool that has access to those tables to modify credential information. Though this seems like a problem that has already been solved by using an LDAP provider with any one of a number of free and open source web interfaces.

Another nifty feature because of the clear separation of concerns is that you can later easily migrate to LDAP or third party services with little effort.

like image 66
nsfyn55 Avatar answered Oct 13 '22 11:10

nsfyn55