Class LDAPCredentialValidator

  • All Implemented Interfaces:
    net.shibboleth.idp.authn.CredentialValidator, net.shibboleth.idp.authn.principal.PrincipalSupportingComponent, net.shibboleth.utilities.java.support.component.Component, net.shibboleth.utilities.java.support.component.DestructableComponent, net.shibboleth.utilities.java.support.component.IdentifiableComponent, net.shibboleth.utilities.java.support.component.IdentifiedComponent, net.shibboleth.utilities.java.support.component.InitializableComponent

    @ThreadSafe
    public class LDAPCredentialValidator
    extends net.shibboleth.idp.authn.AbstractUsernamePasswordCredentialValidator
    A password validator that authenticates against LDAP natively.
    Since:
    4.0.0
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface net.shibboleth.idp.authn.CredentialValidator

        net.shibboleth.idp.authn.CredentialValidator.ErrorHandler, net.shibboleth.idp.authn.CredentialValidator.WarningHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doInitialize()
      protected Subject doValidate​(org.opensaml.profile.context.ProfileRequestContext profileRequestContext, net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext, net.shibboleth.idp.authn.context.UsernamePasswordContext usernamePasswordContext, net.shibboleth.idp.authn.CredentialValidator.WarningHandler warningHandler, net.shibboleth.idp.authn.CredentialValidator.ErrorHandler errorHandler)
      Authenticator getAuthenticator()
      Returns the authenticator.
      String[] getReturnAttributes()
      Returns the return attributes.
      protected Subject populateSubject​(net.shibboleth.idp.authn.context.UsernamePasswordContext usernamePasswordContext, AuthenticationResponse ldapResponse)
      Builds a new Subject populated with the necessary data.
      void setAuthenticator​(Authenticator auth)
      Sets the authenticator.
      void setReturnAttributes​(String... attributes)
      Sets the return attributes.
      • Methods inherited from class net.shibboleth.idp.authn.AbstractUsernamePasswordCredentialValidator

        applyTransforms, doValidate, populateSubject, removeContextAfterValidation, savePasswordToCredentialSet, setLowercase, setMatchExpression, setRemoveContextAfterValidation, setSavePasswordToCredentialSet, setTransforms, setTrim, setUppercase, setUsernamePasswordContextLookupStrategy
      • Methods inherited from class net.shibboleth.idp.authn.AbstractCredentialValidator

        getLogPrefix, getSupportedPrincipals, isAcceptable, populateSubject, setActivationCondition, setId, setSupportedPrincipals, validate
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent

        getId
      • Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent

        destroy, doDestroy, initialize, isDestroyed, isInitialized
      • Methods inherited from interface net.shibboleth.utilities.java.support.component.IdentifiedComponent

        getId
    • Field Detail

      • log

        @Nonnull
        private final org.slf4j.Logger log
        Class logger.
      • authenticator

        @Nonnull
        private Authenticator authenticator
        LDAP authenticator.
      • returnAttributes

        @Nullable
        private String[] returnAttributes
        Attributes to return from authentication.
    • Constructor Detail

      • LDAPCredentialValidator

        public LDAPCredentialValidator()
    • Method Detail

      • getAuthenticator

        @NonnullAfterInit
        public Authenticator getAuthenticator()
        Returns the authenticator.
        Returns:
        authenticator
      • setAuthenticator

        public void setAuthenticator​(@Nonnull
                                     Authenticator auth)
        Sets the authenticator.
        Parameters:
        auth - to authenticate with
      • getReturnAttributes

        @Nullable
        public String[] getReturnAttributes()
        Returns the return attributes.
        Returns:
        attribute names
      • setReturnAttributes

        public void setReturnAttributes​(@Nullable
                                        String... attributes)
        Sets the return attributes.
        Parameters:
        attributes - attribute names
      • doInitialize

        protected void doInitialize()
                             throws net.shibboleth.utilities.java.support.component.ComponentInitializationException
        Overrides:
        doInitialize in class net.shibboleth.utilities.java.support.component.AbstractIdentifiedInitializableComponent
        Throws:
        net.shibboleth.utilities.java.support.component.ComponentInitializationException
      • doValidate

        @Nullable
        protected Subject doValidate​(@Nonnull
                                     org.opensaml.profile.context.ProfileRequestContext profileRequestContext,
                                     @Nonnull
                                     net.shibboleth.idp.authn.context.AuthenticationContext authenticationContext,
                                     @Nonnull
                                     net.shibboleth.idp.authn.context.UsernamePasswordContext usernamePasswordContext,
                                     @Nullable
                                     net.shibboleth.idp.authn.CredentialValidator.WarningHandler warningHandler,
                                     @Nullable
                                     net.shibboleth.idp.authn.CredentialValidator.ErrorHandler errorHandler)
                              throws Exception
        Specified by:
        doValidate in class net.shibboleth.idp.authn.AbstractUsernamePasswordCredentialValidator
        Throws:
        Exception
      • populateSubject

        @Nonnull
        protected Subject populateSubject​(@Nonnull
                                          net.shibboleth.idp.authn.context.UsernamePasswordContext usernamePasswordContext,
                                          @Nonnull
                                          AuthenticationResponse ldapResponse)
        Builds a new Subject populated with the necessary data.
        Parameters:
        usernamePasswordContext - input context
        ldapResponse - LDAP response data
        Returns:
        the subject to return