Package net.shibboleth.idp.authn.context
Class PreferredPrincipalContext
java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.PreferredPrincipalContext
- All Implemented Interfaces:
Iterable<BaseContext>
A context that holds information about an authentication request's
preference for a specific custom
Principal
.
Authentication protocols with features for preferring specific forms of
authentication with optional semantics will populate this context type with
an expression of those preferences in the form of an ordered list of custom
Principal
objects.
- Since:
- 3.4.0
- 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
FieldsModifier and TypeFieldDescriptionThe principals reflecting the preference. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet an immutable list of principals reflecting the request preferences.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.setPreferredPrincipals
(List<Principal> principals) Set list of principals reflecting the request preferences.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
-
preferredPrincipals
The principals reflecting the preference.
-
-
Constructor Details
-
PreferredPrincipalContext
public PreferredPrincipalContext()Constructor.
-
-
Method Details
-
getPreferredPrincipals
Get an immutable list of principals reflecting the request preferences.- Returns:
- immutable list of principals
-
setPreferredPrincipals
@Nonnull public PreferredPrincipalContext setPreferredPrincipals(@Nonnull @NonnullElements List<Principal> principals) Set list of principals reflecting the request preferences.- Parameters:
principals
- list of principals- Returns:
- this context
-
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 preferences
-
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 preferences
-
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 preferences
-