SPT Core API

com.sptci.auth
Class DatabaseLoginModule

java.lang.Object
  extended by com.sptci.auth.AbstractLoginModule
      extended by com.sptci.auth.DatabaseLoginModule
All Implemented Interfaces:
LoginModule

public class DatabaseLoginModule
extends AbstractLoginModule

JAAS login module for user authentication through user information stored in a database table.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: DatabaseLoginModule.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Nikhil 2007-08-02

Field Summary
 
Fields inherited from class com.sptci.auth.AbstractLoginModule
callbackHandler, logger, options, principal, role, sharedState, subject
 
Constructor Summary
DatabaseLoginModule()
           
 
Method Summary
protected  boolean checkPassword(String userName, char[] password, char[] key)
          Check the specified credentials against the data store.
 boolean login()
          Attempts to authenticate the subject against data stored in a database (JDO compliant relational or object data stores).
 
Methods inherited from class com.sptci.auth.AbstractLoginModule
abort, commit, initialize, logout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseLoginModule

public DatabaseLoginModule()
Method Detail

login

public boolean login()
              throws LoginException
Attempts to authenticate the subject against data stored in a database (JDO compliant relational or object data stores).

Throws:
LoginException
See Also:
LoginModule.login()

checkPassword

protected boolean checkPassword(String userName,
                                char[] password,
                                char[] key)
                         throws LoginException
Check the specified credentials against the data store.

Parameters:
userName - The user/login name to check.
password - The password to check.
key - The key to use to decrypt the stored password.
Returns:
Return true if the specified credentials match.
Throws:
LoginException - If errors are encountered while fetching the data from the data store.

SPT Core API