SPT Core API

com.sptci.auth
Class AbstractLoginModule

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

public abstract class AbstractLoginModule
extends Object
implements LoginModule

Abstract JAAS login module for custom implementations.

© Copyright 2007 Sans Pareil Technologies, Inc.

Version:
$Id: AbstractLoginModule.java 4553 2008-12-24 10:34:16Z rakesh $
Author:
Rakesh Vidyadharan 2007-09-07

Field Summary
protected  CallbackHandler callbackHandler
          CallbackHandler for communicating with the end user.
protected static Logger logger
          The logger to use to log errors/messages to.
protected  Map options
          Options specified in the login Configuration for this particular LoginModule.
protected  Principal principal
          A principal that represents the user that is logged in.
protected  Collection<String> role
          A collection of roles assigned to the principal.
protected  Map sharedState
          State shared with other configured LoginModules.
protected  Subject subject
          The Subject to be authenticated.
 
Constructor Summary
AbstractLoginModule()
           
 
Method Summary
 boolean abort()
          Default implementation.
 boolean commit()
          Default implementation.
 void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
          Default implementation.
 boolean logout()
          Default implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.security.auth.spi.LoginModule
login
 

Field Detail

logger

protected static final Logger logger
The logger to use to log errors/messages to.


subject

protected Subject subject
The Subject to be authenticated. This field is set in the initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map) method.


callbackHandler

protected CallbackHandler callbackHandler
CallbackHandler for communicating with the end user. This field is set in the initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map) method.


sharedState

protected Map sharedState
State shared with other configured LoginModules. This field is set in the initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map) method.


options

protected Map options
Options specified in the login Configuration for this particular LoginModule. This field is set in the initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map) method.


role

protected Collection<String> role
A collection of roles assigned to the principal.


principal

protected Principal principal
A principal that represents the user that is logged in.

Constructor Detail

AbstractLoginModule

public AbstractLoginModule()
Method Detail

initialize

public void initialize(Subject subject,
                       CallbackHandler callbackHandler,
                       Map sharedState,
                       Map options)
Default implementation. Sets instance fields with the specified values.

Specified by:
initialize in interface LoginModule
See Also:
LoginModule.initialize(javax.security.auth.Subject, javax.security.auth.callback.CallbackHandler, java.util.Map, java.util.Map)

commit

public boolean commit()
Default implementation. Associates relevant principals with the subject.

Specified by:
commit in interface LoginModule
See Also:
LoginModule.commit()

abort

public boolean abort()
Default implementation. Resets instance fields.

Specified by:
abort in interface LoginModule
See Also:
LoginModule.abort()

logout

public boolean logout()
Default implementation. Resets instance fields.

Specified by:
logout in interface LoginModule
See Also:
LoginModule.logout()

SPT Core API