Class EvidenceVerifyCallback
java.lang.Object
org.wildfly.security.auth.callback.EvidenceVerifyCallback
- All Implemented Interfaces:
Callback,ExtendedCallback
A
Callback for use where credential verification is required.- Author:
- Darran Lofthouse
-
Constructor Summary
ConstructorsConstructorDescriptionEvidenceVerifyCallback(Evidence evidence) Construct a new instance of thisCallback. -
Method Summary
Modifier and TypeMethodDescription<C extends Evidence,R>
RapplyToEvidence(Class<C> evidenceType, String algorithmName, Function<C, R> function) Apply the given function to the acquired evidence, if it is set and of the given type and algorithm.<C extends Evidence,R>
RapplyToEvidence(Class<C> evidenceType, Function<C, R> function) Apply the given function to the acquired evidence, if it is set and of the given type.Get the evidence being verified.<C extends Evidence>
CgetEvidence(Class<C> evidenceType) Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type.<C extends Evidence>
CgetEvidence(Class<C> evidenceType, String algorithmName) Get the acquired evidence, if it is set and of the given type and algorithm, and if so, return the evidence cast to the type.booleanThisCallbackis not optional as verification is required.booleanGet the verification state for the evidence referenced here.booleanThisCallbackneeds to know if evidence validation was successful.voidsetVerified(boolean verified) Set if the evidence referenced here has been verified.
-
Constructor Details
-
EvidenceVerifyCallback
Construct a new instance of thisCallback.- Parameters:
evidence- the evidence to be verified
-
-
Method Details
-
getEvidence
Get the evidence being verified.- Returns:
- the evidence being verified
-
getEvidence
Get the acquired evidence, if it is set and of the given type, and if so, return the evidence cast to the type.- Type Parameters:
C- the evidence type- Parameters:
evidenceType- the evidence type class (must not benull)- Returns:
- the evidence, or
nullif the criteria wasn't met
-
getEvidence
Get the acquired evidence, if it is set and of the given type and algorithm, and if so, return the evidence cast to the type.- Type Parameters:
C- the evidence type- Parameters:
evidenceType- the evidence type class (must not benull)algorithmName- the algorithm name- Returns:
- the evidence, or
nullif the criteria are not met
-
applyToEvidence
Apply the given function to the acquired evidence, if it is set and of the given type.- Type Parameters:
C- the evidence typeR- the return type- Parameters:
evidenceType- the evidence type class (must not benull)function- the function to apply (must not benull)- Returns:
- the result of the function, or
nullif the criteria are not met
-
applyToEvidence
public <C extends Evidence,R> R applyToEvidence(Class<C> evidenceType, String algorithmName, Function<C, R> function) Apply the given function to the acquired evidence, if it is set and of the given type and algorithm.- Type Parameters:
C- the evidence typeR- the return type- Parameters:
evidenceType- the evidence type class (must not benull)algorithmName- the algorithm namefunction- the function to apply (must not benull)- Returns:
- the result of the function, or
nullif the criteria are not met
-
setVerified
public void setVerified(boolean verified) Set if the evidence referenced here has been verified.- Parameters:
verified- the verification state of the evidence
-
isVerified
public boolean isVerified()Get the verification state for the evidence referenced here.- Returns:
trueif the evidence has been verified,falseotherwise
-
isOptional
public boolean isOptional()ThisCallbackis not optional as verification is required.- Specified by:
isOptionalin interfaceExtendedCallback- Returns:
trueif the callback is optional,falseif it is mandatory
-
needsInformation
public boolean needsInformation()ThisCallbackneeds to know if evidence validation was successful.- Specified by:
needsInformationin interfaceExtendedCallback- Returns:
trueif the callback is requesting information,falseif it is only providing information
-