public class FormFieldConfiguration extends Object
| Modifier and Type | Field and Description |
|---|---|
protected String |
ctxtPath
The path to the Webapp.
|
protected Map<String,List<String>> |
fields
A map of {path, fields}.
|
static String |
J_PASSWORD
Form field name for the password.
|
static String |
J_SECURITY_CHECK
Target path for Form Authentication.
|
static String |
J_USERNAME
Form field name for the username.
|
| Constructor and Description |
|---|
FormFieldConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addLoginFormValue(javax.servlet.ServletContext webapp)
Add the login form value if the authentication method
is "Form" (that is to say, bound the form field
"j_password" to the path "/j_security_check" in that
context).
|
protected void |
addValues(String path,
String... formFields)
Called by the extractor for each single parameter found in the configuration.
|
protected void |
extract(javax.servlet.ServletContext webapp)
Extract the parameters from the Webapp configuration.
|
protected List<String> |
get(String path)
Get the fields bound to a path.
|
static Optional<List<String>> |
matches(javax.servlet.ServletContext webapp,
javax.servlet.http.HttpServletRequest request)
Check whether the path of an HTTP request matches
one of those found in the configuration,
and return the list of passwords fields that have
to be captured in a request.
|
static Optional<List<String>> |
matches(javax.servlet.ServletContext webapp,
javax.servlet.http.HttpServletRequest request,
Supplier<FormFieldConfiguration> factory)
Check whether the path of an HTTP request matches
one of those found in the configuration,
and return the list of passwords fields that have
to be captured in a request.
|
static void |
reset(javax.servlet.ServletContext webapp)
Remove this attribute from the Web application.
|
public static final String J_SECURITY_CHECK
public static final String J_USERNAME
public static final String J_PASSWORD
protected String ctxtPath
protected void extract(javax.servlet.ServletContext webapp)
<context-param>
<param-name>ml.alternet.security.web.config.formFields</param-name>
<param-value>
/doRegister.html?pwd&confirmPwd,
/doUpdatePassword.html?oldPwd&newPwd&confirmPwd
</param-value>
</context-param>
webapp - The Web application.protected void addLoginFormValue(javax.servlet.ServletContext webapp)
webapp - The Web application.protected void addValues(String path, String... formFields)
path - The pathformFields - The fieldsprotected List<String> get(String path)
path - The path.public static Optional<List<String>> matches(javax.servlet.ServletContext webapp, javax.servlet.http.HttpServletRequest request)
webapp - The Web application.request - The HTTP request.public static Optional<List<String>> matches(javax.servlet.ServletContext webapp, javax.servlet.http.HttpServletRequest request, Supplier<FormFieldConfiguration> factory)
webapp - The Web application.request - The HTTP request.factory - For creating a specific instance of this class.public static void reset(javax.servlet.ServletContext webapp)
webapp - The Web application.Copyright © 2018 Alternet. All rights reserved.