Package org.apache.wiki.auth.login
Class AnonymousLoginModule
- java.lang.Object
-
- org.apache.wiki.auth.login.AbstractLoginModule
-
- org.apache.wiki.auth.login.AnonymousLoginModule
-
- All Implemented Interfaces:
javax.security.auth.spi.LoginModule
public class AnonymousLoginModule extends AbstractLoginModule
Logs in a user based solely on IP address; no other authentication is performed. Barring a mis-configuration or I/O error, this LoginModule always succeeds.
This module must be used with a CallbackHandler (such asWebContainerCallbackHandler
) that supports the following Callback types:HttpRequestCallback
- supplies the IP address, which is used as a backup in case no name is supplied.
After authentication, a generic WikiPrincipal based on the IP address will be created and associated with the Subject.
- Since:
- 2.3
- See Also:
LoginModule.commit()
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.logging.log4j.Logger
LOG
static java.lang.String
PROMPT
Bogus prompt sent to the callback handler.-
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 AnonymousLoginModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
login()
Logs in the user by calling back to the registered CallbackHandler with a series of callbacks.-
Methods inherited from class org.apache.wiki.auth.login.AbstractLoginModule
abort, commit, initialize, logout
-
-
-
-
Field Detail
-
PROMPT
public static final java.lang.String PROMPT
Bogus prompt sent to the callback handler.- See Also:
- Constant Field Values
-
LOG
protected static final org.apache.logging.log4j.Logger LOG
-
-
Constructor Detail
-
AnonymousLoginModule
public AnonymousLoginModule()
-
-
Method Detail
-
login
public boolean login() throws javax.security.auth.login.LoginException
Logs in the user by calling back to the registered CallbackHandler with a series of callbacks. If the login succeeds, this method returnstrue
Logs in the user by calling back to the registered CallbackHandler with an HttpRequestCallback. The CallbackHandler must supply the current servlet HTTP request as its response.- Specified by:
login
in interfacejavax.security.auth.spi.LoginModule
- Specified by:
login
in classAbstractLoginModule
- Returns:
- the result of the login; this will always be
true
. - Throws:
javax.security.auth.login.LoginException
- if unable to handle callback- See Also:
LoginModule.login()
-
-