org.mortbay.jaas.spi
Class JDBCLoginModule
java.lang.Objectorg.mortbay.jaas.spi.JDBCLoginModule
- LoginModule
public class JDBCLoginModule
extends java.lang.Object
implements LoginModule
JDBCLoginModule
JAAS LoginModule to retrieve user information from
a database and authenticate the user.
Notes
This version uses plain old JDBC connections NOT
Datasources.
Usage
boolean | abort()- Abort login
|
boolean | commit()- Commit the authenticated user
|
void | initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)- Init LoginModule.
|
void | loadUser(String userName)- Load info from database
|
boolean | login()- Authenticate the user.
|
boolean | logout()- Logout authenticated user
|
abort
public boolean abort()
throws LoginExceptionAbort login
commit
public boolean commit()
throws LoginExceptionCommit the authenticated user
initialize
public void initialize(Subject subject,
CallbackHandler callbackHandler,
Map sharedState,
Map options)Init LoginModule.
Called once by JAAS after new instance created.
subject - callbackHandler - sharedState - options -
loadUser
public void loadUser(String userName)
throws SQLExceptionLoad info from database
userName - user info to load
login
public boolean login()
throws LoginExceptionAuthenticate the user.
logout
public boolean logout()
throws LoginExceptionLogout authenticated user
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.