Reputation: 923
My problem is the integration of a security system in my java ee 7 web application with glass fish 4. I have seen several examples of authentication declarative but also programmatic but none of them covered my problem. In my application i have 2 groups which need authentication.
The problem is that the users of these groups are always changing so i want to store all the users in a DB table. Also i want to use @RolesAllowed annotation and programmatic security like ctx.isCallerInRole("ADMIN") because of simplicity.
Summary: I want to store all users in a database table and i want to use @RolesAllowed annotation and programmatic security like ctx.isCallerInRole("ADMIN"). Is this possible to accomplish?
Upvotes: 0
Views: 1169
Reputation: 38132
Yes, this is possible. E.g. look for the "JDBC Realm".
Here is an older tutorial. It might still work with GlassFish 4, though:
https://blogs.oracle.com/swchan/entry/jdbcrealm_in_glassfish
Upvotes: 2