public class RequestedPrincipalContext extends BaseContext
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.
AuthenticationContextBaseContext.ContextSetNoRemoveIteratorDecorator| Modifier and Type | Field and Description |
|---|---|
private PrincipalEvalPredicateFactoryRegistry |
evalRegistry
The registry of predicate factories for custom principal evaluation.
|
private Principal |
matchingPrincipal
The principal that satisfied the request, if any.
|
private String |
operatorString
Comparison operator specific to request protocol.
|
private List<Principal> |
requestedPrincipals
The principals reflecting the request requirements.
|
| Constructor and Description |
|---|
RequestedPrincipalContext()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Principal |
getMatchingPrincipal()
Get the principal that matched the request's requirements, if any.
|
String |
getOperator()
Get the comparison operator for matching requested principals.
|
PrincipalEvalPredicate |
getPredicate(Principal principal)
Get a predicate to apply based on a principal type and the content of this context.
|
PrincipalEvalPredicateFactoryRegistry |
getPrincipalEvalPredicateFactoryRegistry()
Get the registry of predicate factories for custom principal evaluation.
|
List<Principal> |
getRequestedPrincipals()
Get an immutable list of principals reflecting the request requirements.
|
boolean |
isAcceptable(Collection<Principal> principals)
Helper method that evaluates
Principal objects against this context
to determine if the input is compatible with it. |
boolean |
isAcceptable(PrincipalSupportingComponent component)
Helper method that evaluates a
PrincipalSupportingComponent against
this context to determine if the input is compatible with it. |
<T extends Principal> |
isAcceptable(T principal)
Helper method that evaluates a
Principal object against this context
to determine if the input is compatible with it. |
RequestedPrincipalContext |
setMatchingPrincipal(Principal principal)
Set the principal that matched the request's requirements, if any.
|
RequestedPrincipalContext |
setOperator(String operator)
Set the comparison operator for matching requested principals.
|
RequestedPrincipalContext |
setPrincipalEvalPredicateFactoryRegistry(PrincipalEvalPredicateFactoryRegistry registry)
Set the registry of predicate factories for custom principal evaluation.
|
RequestedPrincipalContext |
setRequestedPrincipals(List<Principal> principals)
Set list of principals reflecting the request requirements.
|
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, isAutoCreateSubcontexts, iterator, removeSubcontext, removeSubcontext, setAutoCreateSubcontexts, setParent@Nonnull private PrincipalEvalPredicateFactoryRegistry evalRegistry
@Nullable private String operatorString
@Nonnull @NonnullElements private List<Principal> requestedPrincipals
@Nonnull public PrincipalEvalPredicateFactoryRegistry getPrincipalEvalPredicateFactoryRegistry()
@Nonnull public RequestedPrincipalContext setPrincipalEvalPredicateFactoryRegistry(@Nonnull PrincipalEvalPredicateFactoryRegistry registry)
registry - predicate factory registry@Nonnull @NotEmpty public String getOperator()
@Nonnull public RequestedPrincipalContext setOperator(@Nullable@NotEmpty String operator)
operator - comparison operator@Nonnull @NonnullElements @Unmodifiable @NotLive public List<Principal> getRequestedPrincipals()
@Nonnull public RequestedPrincipalContext setRequestedPrincipals(@Nonnull@NonnullElements List<Principal> principals)
principals - list of principals@Nullable public Principal getMatchingPrincipal()
@Nonnull public RequestedPrincipalContext setMatchingPrincipal(@Nullable Principal principal)
principal - a matching principal, or null@Nullable public PrincipalEvalPredicate getPredicate(@Nonnull Principal principal)
principal - principal to obtain predicate forpublic boolean isAcceptable(@Nonnull PrincipalSupportingComponent component)
PrincipalSupportingComponent against
this context to determine if the input is compatible with it.component - component to evaluatepublic boolean isAcceptable(@Nonnull@NonnullElements Collection<Principal> principals)
Principal objects against this context
to determine if the input is compatible with it.principals - principal(s) to evaluatepublic <T extends Principal> boolean isAcceptable(@Nonnull T principal)
Principal object against this context
to determine if the input is compatible with it.T - type of principalprincipal - principal to evaluateCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.