If you can find a LDAP LoginModule implementation for you , you can config it to be used in JAAS directly. If you cannot find one , you have to write one by yourself.
Another thing is all the code should be called by Subject.doAs or Subject.doAsPrivileged. So you would write some code for that. After that if you change the authentication to a database , you might just change your config file
Thanks
Lin
[ May 06, 2005: Message edited by: LIN FENG ]