org.mortbay.jaas.spi
Class JDBCLoginModule

java.lang.Object
  extended by 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


Constructor Summary
JDBCLoginModule()
           
 
Method Summary
 boolean abort()
          Abort login
 boolean commit()
          Commit the authenticated user
 void initialize(javax.security.auth.Subject subject, javax.security.auth.callback.CallbackHandler callbackHandler, java.util.Map sharedState, java.util.Map options)
          Init LoginModule.
 void loadUser(java.lang.String userName)
          Load info from database
 boolean login()
          Authenticate the user.
 boolean logout()
          Logout authenticated user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCLoginModule

public JDBCLoginModule()
Method Detail

abort

public boolean abort()
              throws javax.security.auth.login.LoginException
Abort login

Specified by:
abort in interface javax.security.auth.spi.LoginModule
Returns:
Throws:
javax.security.auth.login.LoginException

commit

public boolean commit()
               throws javax.security.auth.login.LoginException
Commit the authenticated user

Specified by:
commit in interface javax.security.auth.spi.LoginModule
Returns:
Throws:
javax.security.auth.login.LoginException

login

public boolean login()
              throws javax.security.auth.login.LoginException
Authenticate the user.

Specified by:
login in interface javax.security.auth.spi.LoginModule
Returns:
Throws:
javax.security.auth.login.LoginException

logout

public boolean logout()
               throws javax.security.auth.login.LoginException
Logout authenticated user

Specified by:
logout in interface javax.security.auth.spi.LoginModule
Returns:
Throws:
javax.security.auth.login.LoginException

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
Parameters:
subject -
callbackHandler -
sharedState -
options -

loadUser

public void loadUser(java.lang.String userName)
              throws java.sql.SQLException
Load info from database

Parameters:
userName - user info to load
Throws:
java.sql.SQLException


Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.