java.lang.Object
org.mortbay.jaas.spi.JDBCLoginModule
- All Implemented Interfaces:
- javax.security.auth.spi.LoginModule
- public class JDBCLoginModule
- extends java.lang.Object
- implements javax.security.auth.spi.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.commons.logging.Log log
callbackHandler
private javax.security.auth.callback.CallbackHandler callbackHandler
authState
private boolean authState
commitState
private boolean commitState
subject
private javax.security.auth.Subject subject
principal
private java.security.Principal principal
credential
private org.mortbay.util.Credential credential
roleGroup
private java.security.acl.Group roleGroup
dbCredential
private java.lang.String dbCredential
dbDriver
private java.lang.String dbDriver
dbUrl
private java.lang.String dbUrl
dbUserName
private java.lang.String dbUserName
dbPassword
private java.lang.String dbPassword
userQuery
private java.lang.String userQuery
rolesQuery
private java.lang.String rolesQuery
JDBCLoginModule
public JDBCLoginModule()
abort
public boolean abort()
throws javax.security.auth.login.LoginException
- Abort login
- Specified by:
abort in interface javax.security.auth.spi.LoginModule
commit
public boolean commit()
throws javax.security.auth.login.LoginException
- Commit the authenticated user
- Specified by:
commit in interface javax.security.auth.spi.LoginModule
login
public boolean login()
throws javax.security.auth.login.LoginException
- Authenticate the user.
- Specified by:
login in interface javax.security.auth.spi.LoginModule
logout
public boolean logout()
throws javax.security.auth.login.LoginException
- Logout authenticated user
- Specified by:
logout in interface javax.security.auth.spi.LoginModule
initialize
public void initialize(javax.security.auth.Subject subject,
javax.security.auth.callback.CallbackHandler callbackHandler,
java.util.Map sharedState,
java.util.Map options)
- Init LoginModule.
Called once by JAAS after new instance created.
- Specified by:
initialize in interface javax.security.auth.spi.LoginModule
loadUser
public void loadUser(java.lang.String userName)
throws java.sql.SQLException
- Load info from database