Class AbstractAuthenticationResultPredicate
java.lang.Object
net.shibboleth.idp.authn.context.logic.AbstractAuthenticationResultPredicate
- All Implemented Interfaces:
Predicate<ProfileRequestContext>
- Direct Known Subclasses:
AuthenticationResultPredicate,PrincipalInResultPredicate
public abstract class AbstractAuthenticationResultPredicate
extends Object
implements Predicate<ProfileRequestContext>
Base class for predicates that operate on
AuthenticationResult instances.
This layer handles accessing active results and filters by flow ID, subsequently invoking a checker method for each result. Both OR and AND semantics are supported across multiple results.
An empty result list evaluates to false regardless of those semantics.
If no flows are specified, then only the absence of any results will result in a true outcome.
- Since:
- 5.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionFlow IDs to filter results against, ignoring the others.private booleanWhether to pull results fromAuthenticationContextinstead ofSubjectContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleandoMatch(ProfileRequestContext profileRequestContext, AuthenticationResult result) Evaluate anAuthenticationResultfor a match.protected Collection<AuthenticationResult>getAuthenticationResults(ProfileRequestContext profileRequestContext) Extract all of the relevant results from either the activeAuthenticationContextorSubjectContextas directed, including any nested results such as found with the MFA flow.Gets the specific flow IDs (with the "authn/" prefix added) to pull results from, ignoring others.booleanGets whether pull results fromAuthenticationContextinstead ofSubjectContext.voidsetIncludedFlows(Collection<String> flows) Sets specific flow IDs (minus the "authn/" prefix) to pull results from, ignoring others.voidsetIncludeIntermediateResults(boolean flag) Sets whether pull results fromAuthenticationContextinstead ofSubjectContext.booleantest(ProfileRequestContext input)
-
Field Details
-
includeIntermediateResults
private boolean includeIntermediateResultsWhether to pull results fromAuthenticationContextinstead ofSubjectContext. -
includedFlows
Flow IDs to filter results against, ignoring the others.
-
-
Constructor Details
-
AbstractAuthenticationResultPredicate
public AbstractAuthenticationResultPredicate()Constructor.
-
-
Method Details
-
isIncludeIntermediateResults
public boolean isIncludeIntermediateResults()Gets whether pull results fromAuthenticationContextinstead ofSubjectContext.- Returns:
- as above
-
setIncludeIntermediateResults
public void setIncludeIntermediateResults(boolean flag) Sets whether pull results fromAuthenticationContextinstead ofSubjectContext.Defaults to false, meaning reliance only on
SubjectContext.- Parameters:
flag- flag to set
-
getIncludedFlows
Gets the specific flow IDs (with the "authn/" prefix added) to pull results from, ignoring others.- Returns:
- as above
-
setIncludedFlows
Sets specific flow IDs (minus the "authn/" prefix) to pull results from, ignoring others.- Parameters:
flows- flow IDs to include in evaluation of condition
-
test
- Specified by:
testin interfacePredicate<ProfileRequestContext>
-
getAuthenticationResults
@Nonnull protected Collection<AuthenticationResult> getAuthenticationResults(@Nonnull ProfileRequestContext profileRequestContext) Extract all of the relevant results from either the activeAuthenticationContextorSubjectContextas directed, including any nested results such as found with the MFA flow.- Parameters:
profileRequestContext- profile request context- Returns:
- filtered results
-
doMatch
protected abstract boolean doMatch(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationResult result) Evaluate anAuthenticationResultfor a match.The default evaluation is simply that its existence is sufficient, but subclasses may override for more specific cases.
- Parameters:
profileRequestContext- profile request contextresult- result to evaluate- Returns:
- true iff the subclass deems this a matching result
-