org.mortbay.jaas.spi

Class JDBCLoginModule

Implemented Interfaces:
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

Method Summary

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

Method Details

abort

public boolean abort()
            throws LoginException
Abort login
Returns:

commit

public boolean commit()
            throws LoginException
Commit the authenticated user
Returns:

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map sharedState,
                       Map options)
Init LoginModule. Called once by JAAS after new instance created.
Parameters:
subject -
callbackHandler -
sharedState -
options -

loadUser

public void loadUser(String userName)
            throws SQLException
Load info from database
Parameters:
userName - user info to load

login

public boolean login()
            throws LoginException
Authenticate the user.
Returns:

logout

public boolean logout()
            throws LoginException
Logout authenticated user
Returns:

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