Module io.inverno.mod.security.http
Class FormCredentialsExtractor
java.lang.Object
io.inverno.mod.security.http.form.FormCredentialsExtractor
- All Implemented Interfaces:
CredentialsExtractor<LoginCredentials>
public class FormCredentialsExtractor
extends Object
implements CredentialsExtractor<LoginCredentials>
A credentials extractor that extracts login credentials provided by a user in a form (application/x-www-form-urlencoded
) submitted in an HTTP POST
request.
- Since:
- 1.5
- Author:
- Jeremy Kuhn
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreates a form credentials extractor with default username and password parameter names.FormCredentialsExtractor
(String usernameParameter, String passwordParameter) Creates a form credentials extractor with specified username and password parameter names. -
Method Summary
Modifier and TypeMethodDescriptionExtracts credentials from the specified exchange.Returns the password parameter name.Returns the username parameter name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.inverno.mod.security.http.CredentialsExtractor
or
-
Field Details
-
DEFAULT_PARAMETER_USERNAME
The default username parameter name.- See Also:
-
DEFAULT_PARAMETER_PASSWORD
The default password parameter name.- See Also:
-
-
Constructor Details
-
FormCredentialsExtractor
public FormCredentialsExtractor()Creates a form credentials extractor with default username and password parameter names.
-
FormCredentialsExtractor
Creates a form credentials extractor with specified username and password parameter names.
- Parameters:
usernameParameter
- the username parameter namepasswordParameter
- the password parameter name
-
-
Method Details
-
getUsernameParameter
Returns the username parameter name.
- Returns:
- the username parameter name
-
getPasswordParameter
Returns the password parameter name.
- Returns:
- the password parameter name
-
extract
Description copied from interface:CredentialsExtractor
Extracts credentials from the specified exchange.
- Specified by:
extract
in interfaceCredentialsExtractor<LoginCredentials>
- Parameters:
exchange
- the exchange- Returns:
- a mono emitting the credentials or an empty mono if the exchange didn't provide any credentials
- Throws:
MalformedCredentialsException
- if credentials in the exchange are malformed
-