|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wiki.auth.login.AbstractLoginModule
public abstract class AbstractLoginModule

Abstract JAAS LoginModulethat 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 CallbackHandler |
m_handler
|
protected Map<String,?> |
m_options
|
protected Collection<Principal> |
m_previousWikiPrincipals
Deprecated. |
protected Collection<Principal> |
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<Principal> |
m_principalsToOverwrite
Deprecated. |
protected Collection<Principal> |
m_principalsToRemove
Deprecated. |
protected Map<String,?> |
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()
Commits the login. |
void |
initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> 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 CallbackHandler m_handler
protected Map<String,?> m_options
protected Collection<Principal> m_previousWikiPrincipals
protected Collection<Principal> m_principals
commit() phase of login.
protected Collection<Principal> m_principalsToRemove
Role.
protected Collection<Principal> 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<String,?> 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 LoginModuleLoginException - if the abort itself failsLoginModule.abort()public final boolean commit()
m_principals member variable is consulted to determine
whether to add the principals. If its size is 0 (because the login
failed), the login is considered to have failed; in this case,
all principals in m_principalsToRemove are removed
from the Subject's set. Otherwise, the principals added to
m_principals in the login() method are added to
the Subject's set.
commit in interface LoginModuletrue if the commit succeeded, or
false if the previous call to login()
failedLoginModule.commit()
public final void initialize(Subject subject,
CallbackHandler callbackHandler,
Map<String,?> sharedState,
Map<String,?> options)
Subject,
callback handler, options and shared state. In particular, the member
variable m_principals is initialized as a blank Set.
initialize in interface LoginModulesubject - callbackHandler - sharedState - options - 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 LoginModuletrue 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 LoginModuletrue 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 | |||||||||