public class FormAuthenticationScheme extends Object implements HTTPAuthenticationScheme
HTTPAuthenticationScheme
that supports the Servlet Specification
FORM Authentication SchemeModifier and Type | Field and Description |
---|---|
static String |
FORM_ERROR_PAGE_INIT_PARAM |
static String |
FORM_LOGIN_PAGE_INIT_PARAM |
static String |
J_PASSWORD |
static String |
J_SECURITY_CHECK |
static String |
J_USERNAME |
static String |
SAVED_REQUEST |
static String |
STATE |
Constructor and Description |
---|
FormAuthenticationScheme() |
Modifier and Type | Method and Description |
---|---|
void |
challengeClient(HttpServletRequest request,
HttpServletResponse response)
Challenges the client if no credentials were supplied or the credentials were not extracted in order to continue
with the authentication.
|
void |
extractCredential(HttpServletRequest request,
DefaultLoginCredentials creds)
Extracts the credentials from the given
HttpServletRequest and populates the
DefaultLoginCredentials with them. |
void |
initialize(FilterConfig config)
Called one time by the
AuthenticationFilter after the CDI initialization has completed, but before any
other methods from this interface are invoked. |
boolean |
isProtected(HttpServletRequest request)
Indicates if the given
HttpServletRequest should be protected or not. |
boolean |
postAuthentication(HttpServletRequest request,
HttpServletResponse response)
Performs any post-authentication logic regarding of the authentication result.
|
public static final String FORM_LOGIN_PAGE_INIT_PARAM
public static final String FORM_ERROR_PAGE_INIT_PARAM
public static final String J_SECURITY_CHECK
public static final String J_USERNAME
public static final String J_PASSWORD
public static final String SAVED_REQUEST
public static final String STATE
public void initialize(FilterConfig config)
HTTPAuthenticationScheme
AuthenticationFilter
after the CDI initialization has completed, but before any
other methods from this interface are invoked.initialize
in interface HTTPAuthenticationScheme
config
- the configuration of AuthenticationFilter
from web.xml
. Never null.public void extractCredential(HttpServletRequest request, DefaultLoginCredentials creds)
HTTPAuthenticationScheme
HttpServletRequest
and populates the
DefaultLoginCredentials
with them. If the request is not an authentication attempt (as defined by the
implementation), then creds
is not affected.extractCredential
in interface HTTPAuthenticationScheme
request
- The current request, to examine for authentication information.creds
- The credentials instance that will be populated with the credentials found in the request, if any.public void challengeClient(HttpServletRequest request, HttpServletResponse response) throws IOException
HTTPAuthenticationScheme
challengeClient
in interface HTTPAuthenticationScheme
request
- The current request, which may be used to obtain a RequestDispatcher
if needed.
If this method is called, the rest of the filter chain will not be processed, so
implementations are free to read the request body if they so choose.response
- The current response, which can be used to send HTTP error results, redirects, or for sending
additional challenge headers.IOException
- if reading the request or writing the response fails.public boolean postAuthentication(HttpServletRequest request, HttpServletResponse response) throws IOException
HTTPAuthenticationScheme
postAuthentication
in interface HTTPAuthenticationScheme
request
- The current request, which may be used to obtain a RequestDispatcher
if needed.response
- The current response, which can be used to send an HTTP response, or a redirect.IOException
- if reading the request or writing the response fails.public boolean isProtected(HttpServletRequest request)
HTTPAuthenticationScheme
Indicates if the given HttpServletRequest
should be protected or not.
isProtected
in interface HTTPAuthenticationScheme
Copyright © 2014. All rights reserved.