public class ValidateRemoteUser extends AbstractValidationAction
UsernameContext and directly produces an
AuthenticationResult based on that identity.
Various optional properties are supported to control the validation process.
EventIds.PROCEED_EVENT_ID, EventIds.INVALID_PROFILE_CTX, AuthnEventIds.INVALID_CREDENTIALS, AuthnEventIds.NO_CREDENTIALSProfileRequestContext.getSubcontext(AuthenticationContext.class, false).getAttemptedFlow() != null
AuthenticationResult is saved to the AuthenticationContext.| Modifier and Type | Field and Description |
|---|---|
private Set<String> |
blacklistedUsernames
A blacklist of usernames to deny.
|
private static String |
DEFAULT_METRIC_NAME
Default prefix for metrics.
|
private org.slf4j.Logger |
log
Class logger.
|
private Pattern |
matchExpression
A regular expression to apply for acceptance testing.
|
private UsernameContext |
usernameContext
Username context identifying identity to validate.
|
private Set<String> |
whitelistedUsernames
A whitelist of usernames to accept.
|
| Constructor and Description |
|---|
ValidateRemoteUser()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected boolean |
doPreExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
private boolean |
isAuthenticated(String username)
Check whitelist, blacklist, and matching expression for acceptance.
|
protected Subject |
populateSubject(Subject subject) |
void |
setBlacklistedUsernames(Collection<String> blacklist)
Set the blacklisted usernames.
|
void |
setMatchExpression(Pattern expression)
Set a matching expression to apply for acceptance.
|
void |
setWhitelistedUsernames(Collection<String> whitelist)
Set the whitelisted usernames.
|
addDefaultPrincipals, buildAuthenticationResult, getClassifiedErrors, getMetricName, getResultCachingPredicate, getSubject, getSupportedPrincipals, handleError, handleError, handleWarning, recordFailure, recordSuccess, setAddDefaultPrincipals, setClassifiedMessages, setMetricName, setRequesterLookupStrategy, setResponderLookupStrategy, setResultCachingPredicate, setSupportedPrincipalsdoExecute, doPreExecute, setLookupStrategydoExecute, execute, getMessage, getMessage, getMessage, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategygetActivationCondition, setActivationConditiondoPostExecute, doPostExecute, execute, getHttpServletRequest, getHttpServletResponse, getLogPrefix, setHttpServletRequest, setHttpServletResponsedestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull @NotEmpty private static final String DEFAULT_METRIC_NAME
@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private Set<String> whitelistedUsernames
@Nonnull @NonnullElements private Set<String> blacklistedUsernames
@Nullable private Pattern matchExpression
@Nullable private UsernameContext usernameContext
public void setWhitelistedUsernames(@Nonnull@NonnullElements Collection<String> whitelist)
whitelist - whitelist to setpublic void setBlacklistedUsernames(@Nonnull@NonnullElements Collection<String> blacklist)
blacklist - blacklist to setpublic void setMatchExpression(@Nullable Pattern expression)
expression - a matching expressionprotected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doPreExecute in class AbstractValidationActionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationActionprivate boolean isAuthenticated(@Nonnull@NotEmpty String username)
username - the username to evaluate@Nonnull protected Subject populateSubject(@Nonnull Subject subject)
populateSubject in class AbstractValidationActionCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.