Authorization using JAAS RDBMS LoginModule from Swing Application

My goal is to design an Authentication and Authorization system based on settings stored in an RDBMS schema. These settings would control which users would have certain CRUD operations associated to Features or specific Functionality.

I also want to declaratively control the association between the CRUD settings and the Functionality from an Admin Process within the Swing application. I was hoping to use JAAS to handle the Authorization process based on the settings managed in the schema.

My questions are focuses on the Subject/Principal relationship mostly. How do I control which Principals a given Subject has access to based on(in this case) boolean settings for the CRUD operations assigned to each area of Functionality? Will the Subject.doAs or Subject.doAsPriviledged be useful?

I guess I need a good starting point after reading several tutorials at java.sun.com and articles elsewhere regarding JAAS using different LoginModules.

Any help is much appreciated!

Mark

[1018 byte] By [mark_in_gra] at [2007-10-3 9:23:22]
# 1
So, no one out here has done anything like this?
mark_in_gra at 2007-7-15 4:37:10 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 2

Hi,

you can look towards jguard (http://www.jguard.net) which provides JAAS security and flexibility for webapps and standalone applications.

you can see code in action in the jguard-swing-example in the distribution in the last 1.0.0-RC2 release.

cheers,

Charles.

jguard team.

http://www.jguard.net

diabolo512a at 2007-7-15 4:37:10 > top of Java-index,Security,Other Security APIs, Tools, and Issues...
# 3

Hi,

the most simpliest approach is to add role principals to teh Subject (just create a custom Principal that you call role and that takes the role name as an argument). Thsi can be added upon database authentication. Then when the user performs a CRUD operation you check if teh Subject contains the required role. No need fot checkPermission calls unless you want to go fine granular with JAAS permissions defined on teh row level

Frank

fnimphiua at 2007-7-15 4:37:10 > top of Java-index,Security,Other Security APIs, Tools, and Issues...