public class ValidateUsernamePasswordAgainstKerberos extends AbstractUsernamePasswordValidationAction
UsernamePasswordContext and directly produces an
AuthenticationResult based on that identity by acquiring
a TGT and optional service ticket from Kerberos.EventIds.PROCEED_EVENT_ID, AuthnEventIds.AUTHN_EXCEPTION, AuthnEventIds.INVALID_CREDENTIALSProfileRequestContext.getSubcontext(AuthenticationContext.class, false).getAttemptedFlow() != null
AuthenticationResult is saved to the AuthenticationContext on a
successful login. On a failed login, the AbstractValidationAction.handleError(
ProfileRequestContext, AuthenticationContext, Exception, String) method is called.| Modifier and Type | Class and Description |
|---|---|
private class |
ValidateUsernamePasswordAgainstKerberos.SimpleCallbackHandler
A callback handler that provides static name and password data to a JAAS login process.
|
| Modifier and Type | Field and Description |
|---|---|
private Map<String,String> |
clientOptions
JAAS options for client login.
|
private static String |
DEFAULT_METRIC_NAME
Default prefix for metrics.
|
private String |
keytabPath
Path to keytab for service principal.
|
private org.slf4j.Logger |
log
Class logger.
|
private String |
loginModuleClassName
Class name of JAAS LoginModule to acquire Kerberos credentials.
|
private boolean |
preserveTicket
Save the TGT in the resulting Subject?
|
private boolean |
refreshKrb5Config
Refresh the Kerberos config before running?
|
private Map<String,String> |
serverOptions
JAAS options for server login.
|
private String |
servicePrincipal
Service principal to acquire a ticket for to verify KDC.
|
| Constructor and Description |
|---|
ValidateUsernamePasswordAgainstKerberos()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doExecute(ProfileRequestContext profileRequestContext,
AuthenticationContext authenticationContext) |
protected void |
doInitialize() |
protected Subject |
populateSubject(Subject subject) |
void |
setKeytabPath(String path)
Provides a keytab for the service principal to use to verify the KDC.
|
void |
setLoginModuleClassName(String name)
Set the name of the JAAS LoginModule to use to acquire Kerberos credentials.
|
void |
setPreserveTicket(boolean flag)
Set whether to save the TGT in the Subject.
|
void |
setRefreshKrb5Config(boolean flag)
Set whether to refresh the Kerberos configuration before running.
|
void |
setServicePrincipal(String name)
Set the name of a service principal to use to verify the KDC.
|
private void |
verifyKDC()
Use credentials to acquire and verify a service ticket.
|
doPreExecute, getLockoutManager, getUsernamePasswordContext, recordFailure, recordSuccess, removeContextAfterValidation, savePasswordToCredentialSet, setLockoutManager, setMatchExpression, setRemoveContextAfterValidation, setSavePasswordToCredentialSetaddDefaultPrincipals, 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, 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
@NonnullAfterInit @NotEmpty private String loginModuleClassName
private boolean refreshKrb5Config
private boolean preserveTicket
private String servicePrincipal
private String keytabPath
@NonnullAfterInit private Map<String,String> clientOptions
@NonnullAfterInit private Map<String,String> serverOptions
public ValidateUsernamePasswordAgainstKerberos()
public void setLoginModuleClassName(@Nonnull String name)
name - name of login module classpublic void setRefreshKrb5Config(boolean flag)
flag - flag to setpublic void setPreserveTicket(boolean flag)
flag - flag to setpublic void setServicePrincipal(@Nullable String name)
If non-null, a keytab resource must also be set.
name - name of service principalpublic void setKeytabPath(@Nullable String path)
path - path to file containing a keytabprotected void doInitialize()
throws ComponentInitializationException
doInitialize in class AbstractInitializableComponentComponentInitializationExceptionprotected void doExecute(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull AuthenticationContext authenticationContext)
doExecute in class AbstractAuthenticationAction@Nonnull protected Subject populateSubject(@Nonnull Subject subject)
populateSubject in class AbstractUsernamePasswordValidationActionCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.