Package org.apache.wiki.auth.login
Class WebContainerLoginModule
- java.lang.Object
-
- org.apache.wiki.auth.login.AbstractLoginModule
-
- org.apache.wiki.auth.login.WebContainerLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
public class WebContainerLoginModule extends AbstractLoginModule
Logs in a user by extracting authentication data from an Http servlet session. First, the module tries to extract a Principal object out of the request directly using the servlet requests's
getUserPrincipal()method. If one is found, authentication succeeds. If there is no Principal in the request, try callinggetRemoteUser(). If theremoteUserexists but the UserDatabase can't find a matching profile, a generic WikiPrincipal is created with this value. If neitheruserPrincipalnorremoteUserexist in the request, the login fails.This module must be used with a CallbackHandler that supports the following Callback types:
HttpRequestCallback- supplies the Http request object, from which the getRemoteUser and getUserPrincipal are extractedUserDatabaseCallback- supplies the user database for looking up the value of getRemoteUser
After authentication, the Subject will contain the Principal that represents the logged-in user.
- Since:
- 2.3
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.logging.log4j.LoggerLOG-
Fields inherited from class org.apache.wiki.auth.login.AbstractLoginModule
m_handler, m_options, m_principals, m_state, m_subject, NULL
-
-
Constructor Summary
Constructors Constructor Description WebContainerLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanlogin()Logs in the user.-
Methods inherited from class org.apache.wiki.auth.login.AbstractLoginModule
abort, commit, initialize, logout
-
-
-
-
Field Detail
-
LOG
protected static final org.apache.logging.log4j.Logger LOG
-
-
Constructor Detail
-
WebContainerLoginModule
public WebContainerLoginModule()
-
-
Method Detail
-
login
public boolean login() throws javax.security.auth.login.LoginException
Logs in the user.- Specified by:
loginin interfacejavax.security.auth.spi.LoginModule- Specified by:
loginin classAbstractLoginModule- Returns:
trueif the commit succeeded, orfalseif this LoginModule should be ignored.- Throws:
javax.security.auth.login.LoginException- if the authentication fails- See Also:
LoginModule.login()
-
-