|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wiki.auth.login.AbstractLoginModule org.apache.wiki.auth.login.CookieAssertionLoginModule
public class CookieAssertionLoginModule
Logs in a user based on assertion of a name supplied in a cookie. If the cookie is not found, authentication fails.
This module must be used with a CallbackHandler (such asWebContainerCallbackHandler
) that supports the following Callback
types:
HttpRequestCallback
- supplies the cookie, which should contain
a user name.After authentication, a generic WikiPrincipal based on the username will be created and associated with the Subject.
LoginModule.commit()
,
CookieAuthenticationLoginModule
Field Summary | |
---|---|
protected static org.apache.log4j.Logger |
log
|
static String |
PREFS_COOKIE_NAME
The name of the cookie that gets stored to the user browser. |
static String |
PROMPT
Deprecated. |
Fields inherited from class org.apache.wiki.auth.login.AbstractLoginModule |
---|
m_handler, m_options, m_previousWikiPrincipals, m_principals, m_principalsToOverwrite, m_principalsToRemove, m_state, m_subject, NULL |
Constructor Summary | |
---|---|
CookieAssertionLoginModule()
|
Method Summary | |
---|---|
static void |
clearUserCookie(javax.servlet.http.HttpServletResponse response)
Removes the user cookie from the response. |
static String |
getUserCookie(javax.servlet.http.HttpServletRequest request)
Returns the username cookie value. |
boolean |
login()
Logs in the user by calling back to the registered CallbackHandler with an HttpRequestCallback. |
static void |
setUserCookie(javax.servlet.http.HttpServletResponse response,
String name)
Sets the username cookie. |
Methods inherited from class org.apache.wiki.auth.login.AbstractLoginModule |
---|
abort, commit, initialize, logout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PREFS_COOKIE_NAME
public static final String PROMPT
protected static final org.apache.log4j.Logger log
Constructor Detail |
---|
public CookieAssertionLoginModule()
Method Detail |
---|
public boolean login() throws LoginException
login
in interface LoginModule
login
in class AbstractLoginModule
true
. If not found, this
method throws a FailedLoginException
.
{@inheritDoc}
LoginException
- if the authentication failsLoginModule.login()
public static String getUserCookie(javax.servlet.http.HttpServletRequest request)
request
- The Servlet request, as usual.
public static void setUserCookie(javax.servlet.http.HttpServletResponse response, String name)
response
- The Servlet responsename
- The name to write into the cookie.public static void clearUserCookie(javax.servlet.http.HttpServletResponse response)
response
- The servlet response.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |