Reputation: 2583
For a current application, the customer has given us the following requirements:
I am wondering if anyone has any ideas about how I could accomplish this as I have only worked with glassfish using the predefined realms, never having to create one. The flow of this is that after the application has been deployed, the admins can choose whether the users accessing the site authenticate against an LDAP or a local JDBC Database. This decision should not effect the flow of the front end, meaning that there should only be one login page, that goes to one function, that would then, based on the configuration, determine which realm to use to authenticate against.
Any help would be greatly appreciated.
Upvotes: 1
Views: 1094
Reputation: 7449
i think you have three alternatives:
configure both glassfish realms and switch between them in web.xml:/web-app/login-config/auth-realm
deveop your own glassfish realm which encapsulates the jdbc realm and ldap realm
deveop a pluggable authentication architecture (JASPIC)
if you really want a pluggable auth, some references are here and the excellent article from Arjan Tijms
good luck!
Upvotes: 2