Class ParameterExtractor
java.lang.Object
org.pac4j.core.credentials.extractor.ParameterExtractor
- All Implemented Interfaces:
CredentialsExtractor
To extract a parameter value.
- Since:
- 1.8.0
- Author:
- Jerome Leleu
-
Constructor Summary
ConstructorDescriptionParameterExtractor
(String parameterName) Constructor for ParameterExtractor.ParameterExtractor
(String parameterName, boolean supportGetRequest, boolean supportPostRequest) Constructor for ParameterExtractor. -
Method Summary
Modifier and TypeMethodDescriptionextract
(CallContext ctx) Extract theCredentials
from aWebContext
and returnOptional.empty()
if no credentials are present or throw aCredentialsException
if it cannot get it.
-
Constructor Details
-
ParameterExtractor
Constructor for ParameterExtractor.
- Parameters:
parameterName
- aString
object
-
ParameterExtractor
public ParameterExtractor(String parameterName, boolean supportGetRequest, boolean supportPostRequest) Constructor for ParameterExtractor.
- Parameters:
parameterName
- aString
objectsupportGetRequest
- a booleansupportPostRequest
- a boolean
-
-
Method Details
-
extract
Extract theCredentials
from aWebContext
and returnOptional.empty()
if no credentials are present or throw aCredentialsException
if it cannot get it.- Specified by:
extract
in interfaceCredentialsExtractor
- Parameters:
ctx
- the current context- Returns:
- the credentials (optional)
-