InboundMessageType - type of in-bound messageOutboundMessageType - type of out-bound messagepublic abstract class AbstractValidationAction<InboundMessageType,OutboundMessageType> extends AbstractAuthenticationAction<InboundMessageType,OutboundMessageType> implements PrincipalSupportingComponent
AuthenticationResult.| Modifier and Type | Class and Description |
|---|---|
private class |
AbstractValidationAction.MessageChecker
A predicate that examines a message to see if it contains a particular String.
|
| Modifier and Type | Field and Description |
|---|---|
private Subject |
authenticatedSubject
Basis for
AuthenticationResult. |
private Map<String,Collection<String>> |
classifiedMessages
Error messages associated with a specific error condition token.
|
private boolean |
clearErrorContext
Indicates whether to clear any existing
AuthenticationErrorContext before execution. |
private Logger |
log
Class logger.
|
private boolean |
principalsAdded
Track whether custom principals have been explicitly set (including the empty set).
|
private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> |
requesterLookupStrategy
Function used to obtain the requester ID.
|
private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> |
responderLookupStrategy
Function used to obtain the responder ID.
|
private com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> |
resultCachingPredicate
Predicate to apply when setting AuthenticationResult cacheability.
|
| Constructor and Description |
|---|
AbstractValidationAction()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildAuthenticationResult(org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext,
AuthenticationContext authenticationContext)
Normally called upon successful completion of credential validation, calls the
populateSubject(Subject)
abstract method, stores an AuthenticationResult in the AuthenticationContext, and attaches a
SubjectCanonicalizationContext to the ProfileRequestContext in preparation for c14n to occur. |
protected boolean |
doPreExecute(org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext,
AuthenticationContext authenticationContext)
Performs this authentication action's pre-execute step.
|
Map<String,Collection<String>> |
getClassifiedErrors()
Get the error messages classified by specific error conditions.
|
com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> |
getResultCachingPredicate()
Get predicate to apply to determine cacheability of
AuthenticationResult. |
protected Subject |
getSubject()
Get the subject to be produced by successful execution of this action.
|
<T extends Principal> |
getSupportedPrincipals(Class<T> c)
Get an immutable set of supported custom principals that the component produces, supports, contains, etc.
|
protected void |
handleError(org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext,
AuthenticationContext authenticationContext,
Exception e,
String eventId)
Adds an exception encountered during the action to an
AuthenticationErrorContext, creating one if
necessary, beneath the AuthenticationContext. |
protected void |
handleError(org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext,
AuthenticationContext authenticationContext,
String message,
String eventId)
Evaluates a message as a potential match as a "classified" error and if matched, the classification
label is attached to an
AuthenticationErrorContext and used as the resulting event for the action. |
protected void |
handleWarning(org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext,
AuthenticationContext authenticationContext,
String message,
String eventId)
Evaluates a message as a potential match as a "classified" warning and if matched, the classification
label is attached to an
AuthenticationWarningContext and used as the resulting event for the action. |
protected abstract Subject |
populateSubject(Subject subject)
|
void |
setClassifiedMessages(Map<String,Collection<String>> messages)
Set the error messages indicating an unknown username.
|
void |
setRequesterLookupStrategy(com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
Set the strategy used to locate the requester ID for canonicalization.
|
void |
setResponderLookupStrategy(com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
Set the strategy used to locate the responder ID for canonicalization.
|
void |
setResultCachingPredicate(com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
Set predicate to apply to determine cacheability of
AuthenticationResult. |
<T extends Principal> |
setSupportedPrincipals(Collection<T> principals)
Set supported non-user-specific principals that the action will include in the subjects
it generates.
|
doExecute, doExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitialized@Nonnull private final Subject authenticatedSubject
AuthenticationResult.private boolean principalsAdded
private boolean clearErrorContext
AuthenticationErrorContext before execution.@Nonnull @NonnullElements private Map<String,Collection<String>> classifiedMessages
@Nullable private com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> resultCachingPredicate
@Nullable private com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> requesterLookupStrategy
@Nonnull @NonnullElements @Unmodifiable @NotLive public Map<String,Collection<String>> getClassifiedErrors()
public void setClassifiedMessages(@Nonnull@NonnullElements Map<String,Collection<String>> messages)
messages - the "unknown username" error messages to set@Nullable public com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> getResultCachingPredicate()
AuthenticationResult.public void setResultCachingPredicate(@Nullable com.google.common.base.Predicate<org.opensaml.profile.context.ProfileRequestContext> predicate)
AuthenticationResult.predicate - predicate to apply, or nullpublic void setRequesterLookupStrategy(@Nullable com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
strategy - lookup strategypublic void setResponderLookupStrategy(@Nullable com.google.common.base.Function<org.opensaml.profile.context.ProfileRequestContext,String> strategy)
strategy - lookup strategy@Nonnull @NonnullElements @Unmodifiable @NotLive public <T extends Principal> Set<T> getSupportedPrincipals(@Nonnull Class<T> c)
getSupportedPrincipals in interface PrincipalSupportingComponentT - type of Principal to inquire onc - type of Principal to inquire onpublic <T extends Principal> void setSupportedPrincipals(@Nonnull@NonnullElements Collection<T> principals)
T - a type of principal to add, if not genericprincipals - supported principals to include@Nonnull protected Subject getSubject()
protected boolean doPreExecute(@Nonnull org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doPreExecute in class AbstractAuthenticationAction<InboundMessageType,OutboundMessageType>profileRequestContext - the current IdP profile request contextauthenticationContext - the current authentication contextprotected void buildAuthenticationResult(@Nonnull org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
populateSubject(Subject)
abstract method, stores an AuthenticationResult in the AuthenticationContext, and attaches a
SubjectCanonicalizationContext to the ProfileRequestContext in preparation for c14n to occur.profileRequestContext - the current profile request contextauthenticationContext - the current authentication context@Nonnull protected abstract Subject populateSubject(@Nonnull Subject subject)
Subject with
Principal and credential information based on the validation they perform.
Typically this will include attaching a UsernamePrincipal,
but this is not a requirement if other components are suitably overridden.
subject - subject to populateprotected void handleError(@Nonnull org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nonnull Exception e, @Nonnull@NotEmpty String eventId)
AuthenticationErrorContext, creating one if
necessary, beneath the AuthenticationContext.
The exception message is evaluated as a potential match as a "classified" error and if matched,
the classification label is attached to the AuthenticationErrorContext and used as the
resulting event for the action.
profileRequestContext - the current profile request contextauthenticationContext - the current authentication contexte - the exception to processeventId - the event to "return" via an EventContext if
the exception message is not classifiedprotected void handleError(@Nonnull org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nullable String message, @Nonnull@NotEmpty String eventId)
AuthenticationErrorContext and used as the resulting event for the action.
If no match, the supplied eventId is used as the result.
If multiple matches, the first matching label is used as the result, but each match is added to the context.
profileRequestContext - the current profile request contextauthenticationContext - the current authentication contextmessage - to processeventId - the event to "return" via an EventContext if
the message is not classifiedprotected void handleWarning(@Nonnull org.opensaml.profile.context.ProfileRequestContext<InboundMessageType,OutboundMessageType> profileRequestContext, @Nonnull AuthenticationContext authenticationContext, @Nullable String message, @Nonnull@NotEmpty String eventId)
AuthenticationWarningContext and used as the resulting event for the action.
If no match, the supplied eventId is used as the result.
If multiple matches, the first matching label is used as the result, but each match is added to the context.
profileRequestContext - the current profile request contextauthenticationContext - the current authentication contextmessage - to processeventId - the event to "return" via an EventContext if
the message is not classifiedCopyright © 1999–2015. All rights reserved.