|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.auth.login.AbstractLoginModule
public abstract class AbstractLoginModule
Abstract JAAS LoginModule
that implements
base functionality. The methods login()
and commit()
must
be implemented by subclasses. The default implementations of
initialize(Subject, CallbackHandler, Map, Map)
, abort()
and
logout()
should be sufficient for most purposes.
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
protected CallbackHandler |
m_handler
|
protected Map |
m_options
|
protected Collection |
m_previousWikiPrincipals
Collection of Principals set during login module initialization. |
protected Collection |
m_principals
Implementing classes should add Principals to this collection; these will be added to the principal set when the overall login succeeds. |
protected Collection |
m_principalsToOverwrite
Implementing classes should add Principals to this collection to specify what Principals, perhaps suppled by other LoginModules, must be removed if login for this module, or for the entire login configuration overall, succeeds. |
protected Collection |
m_principalsToRemove
Implementing classes should add Principals to this collection to specify what Principals must be removed if login for this module, or for the entire login configuration overall, fails. |
protected Map |
m_state
|
protected Subject |
m_subject
|
protected static String |
NULL
|
Constructor Summary | |
---|---|
AbstractLoginModule()
|
Method Summary | |
---|---|
boolean |
abort()
Aborts the login; called if the LoginContext's overall authentication failed. |
boolean |
commit()
|
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map sharedState,
Map options)
Initializes the LoginModule with a given Subject ,
callback handler, options and shared state. |
abstract boolean |
login()
Logs in the user by calling back to the registered CallbackHandler with a series of callbacks. |
boolean |
logout()
Logs the user out. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.log4j.Logger log
protected CallbackHandler m_handler
protected Map m_options
protected Collection m_previousWikiPrincipals
protected Collection m_principals
commit()
phase of login.
protected Collection m_principalsToRemove
Role
.
protected Collection m_principalsToOverwrite
Role
. For example,
CookieAssertionLoginModule
adds
Role.ANONYMOUS
to its
m_principalsToOverwrite
collection because when it
succeeds, its own Role.AUTHENTICATED
should over-write Role.ANONYMOUS
.
protected Map m_state
protected Subject m_subject
protected static final String NULL
Constructor Detail |
---|
public AbstractLoginModule()
Method Detail |
---|
public final boolean abort() throws LoginException
m_principalsToRemove
.
It always returns true
.
abort
in interface LoginModule
LoginException
- if the abort itself failsLoginModule.abort()
public final boolean commit() throws LoginException
commit
in interface LoginModule
LoginException
LoginModule.commit()
public final void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options)
Subject
,
callback handler, options and shared state. In particular, the member
variable m_principals
is initialized as a blank Set.
initialize
in interface LoginModule
LoginModule.initialize(javax.security.auth.Subject,
javax.security.auth.callback.CallbackHandler, java.util.Map,
java.util.Map)
public abstract boolean login() throws LoginException
true
login
in interface LoginModule
true
if the commit succeeded, or
false
if this LoginModule should be ignored.
LoginException
- if the authentication failsLoginModule.login()
public final boolean logout() throws LoginException
m_principalsToRemove
from the Subject's principal set.
logout
in interface LoginModule
true
if the commit succeeded, or
false
if this LoginModule should be ignored
LoginException
- if the logout itself failsLoginModule.logout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |