The ScriptLoginModule uses the Java Scripting API, making it possible to execute Javascript (or any other scripting language) for the user authentication process. See example:
This script authenticates only two users: "michael" and "eddie". The "user" and the "password" variables are bound by the ScriptLoginModule. The "groups" is the list of groups the user belongs to. Let's make it better. We are going to use an EJB. See example:
Now we are using our own EJB to authenticate the users, and we can be very creative on how to do it. I am not that creative so I am going to use a dummy service. :O)
How would you use this class to authenticate against Google or an LDAP server? |
No comments:
Post a Comment