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.
| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.logging.log4j.Logger |
LOG |
static java.lang.String |
PROMPT
Bogus prompt sent to the callback handler.
|
m_handler, m_options, m_principals, m_state, m_subject, NULL| Constructor and Description |
|---|
AnonymousLoginModule() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
login()
Logs in the user by calling back to the registered CallbackHandler with a
series of callbacks.
|
abort, commit, initialize, logoutpublic static final java.lang.String PROMPT
protected static final org.apache.logging.log4j.Logger LOG
public AnonymousLoginModule()
public boolean login() throws javax.security.auth.login.LoginException
true
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.login in interface javax.security.auth.spi.LoginModulelogin in class AbstractLoginModuletrue.javax.security.auth.login.LoginException - if unable to handle callbackLoginModule.login()Copyright (c) 2001-2022 The Apache Software Foundation. All rights reserved.