Package net.shibboleth.idp.authn.context
Class RequestedPrincipalContext
java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.RequestedPrincipalContext
- All Implemented Interfaces:
Iterable<BaseContext>
A context that holds information about an authentication request's
requirement for a specific custom
Principal
.
Authentication protocols with features for requesting specific forms of
authentication will populate this context type with an expression of those
requirements in the form of a protocol-specific operator string and an ordered
list of custom Principal
objects.
During the authentication process, interactions with
PrincipalSupportingComponent
-supporting objects
will depend on them satisfying context requirements, via the use of registered
PrincipalEvalPredicateFactory
objects.
Upon successful authentication the most appropriate "matching" Principal
will be
saved back to this context for use in generating a protocol response.
- Parent:
AuthenticationContext
- Added:
- Before the authentication process begins
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext
BaseContext.ContextSetNoRemoveIteratorDecorator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the principal that matched the request's requirements, if any.Get the comparison operator for matching requested principals.getPredicate
(Principal principal) Get a predicate to apply based on a principal type and the content of this context.Get the registry of predicate factories for custom principal evaluation.Get an immutable list of principals reflecting the request requirements.boolean
isAcceptable
(Collection<Principal> principals) Helper method that evaluatesPrincipal
objects against this context to determine if the input is compatible with it.boolean
isAcceptable
(PrincipalSupportingComponent component) Helper method that evaluates aPrincipalSupportingComponent
against this context to determine if the input is compatible with it.<T extends Principal>
booleanisAcceptable
(T principal) Helper method that evaluates aPrincipal
object against this context to determine if the input is compatible with it.setMatchingPrincipal
(Principal principal) Set the principal that matched the request's requirements, if any.setOperator
(String operator) Set the comparison operator for matching requested principals.Set the registry of predicate factories for custom principal evaluation.setRequestedPrincipals
(List<Principal> principals) Set list of principals reflecting the request requirements.Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeSubcontext, removeSubcontext, setParent
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
evalRegistry
The registry of predicate factories for custom principal evaluation. -
operatorString
Comparison operator specific to request protocol. -
requestedPrincipals
The principals reflecting the request requirements. -
matchingPrincipal
The principal that satisfied the request, if any.
-
-
Constructor Details
-
RequestedPrincipalContext
public RequestedPrincipalContext()Constructor.
-
-
Method Details
-
getPrincipalEvalPredicateFactoryRegistry
Get the registry of predicate factories for custom principal evaluation.- Returns:
- predicate factory registry
- Since:
- 3.3.0
-
setPrincipalEvalPredicateFactoryRegistry
@Nonnull public RequestedPrincipalContext setPrincipalEvalPredicateFactoryRegistry(@Nonnull PrincipalEvalPredicateFactoryRegistry registry) Set the registry of predicate factories for custom principal evaluation.- Parameters:
registry
- predicate factory registry- Returns:
- this context
- Since:
- 3.3.0
-
getOperator
Get the comparison operator for matching requested principals.- Returns:
- comparison operator
-
setOperator
Set the comparison operator for matching requested principals.- Parameters:
operator
- comparison operator- Returns:
- this context
-
getRequestedPrincipals
Get an immutable list of principals reflecting the request requirements.- Returns:
- immutable list of principals
-
setRequestedPrincipals
@Nonnull public RequestedPrincipalContext setRequestedPrincipals(@Nonnull @NonnullElements List<Principal> principals) Set list of principals reflecting the request requirements.- Parameters:
principals
- list of principals- Returns:
- this context
-
getMatchingPrincipal
Get the principal that matched the request's requirements, if any.- Returns:
- a matching principal, or null
-
setMatchingPrincipal
Set the principal that matched the request's requirements, if any.- Parameters:
principal
- a matching principal, or null- Returns:
- this context
-
getPredicate
Get a predicate to apply based on a principal type and the content of this context.- Parameters:
principal
- principal to obtain predicate for- Returns:
- predicate or null
-
isAcceptable
Helper method that evaluates aPrincipalSupportingComponent
against this context to determine if the input is compatible with it.- Parameters:
component
- component to evaluate- Returns:
- true iff the input is compatible with the requested authentication requirements
- Since:
- 3.3.0
-
isAcceptable
Helper method that evaluatesPrincipal
objects against this context to determine if the input is compatible with it.- Parameters:
principals
- principal(s) to evaluate- Returns:
- true iff the input is compatible with the requested authentication requirements
- Since:
- 3.3.0
-
isAcceptable
Helper method that evaluates aPrincipal
object against this context to determine if the input is compatible with it.- Type Parameters:
T
- type of principal- Parameters:
principal
- principal to evaluate- Returns:
- true iff the input is compatible with the requested authentication requirements
-