org.mortbay.jaas.spi

Class JDBCLoginModule

public class JDBCLoginModule extends 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
booleanabort()
Abort login
booleancommit()
Commit the authenticated user
voidinitialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
Init LoginModule.
voidloadUser(String userName)
Load info from database
booleanlogin()
Authenticate the user.
booleanlogout()
Logout authenticated user

Method Detail

abort

public boolean abort()
Abort login

Returns:

Throws: LoginException

commit

public boolean commit()
Commit the authenticated user

Returns:

Throws: LoginException

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)
Load info from database

Parameters: userName user info to load

Throws: SQLException

login

public boolean login()
Authenticate the user.

Returns:

Throws: LoginException

logout

public boolean logout()
Logout authenticated user

Returns:

Throws: LoginException

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