Class ADtoDBHybridAuthenticator

All Implemented Interfaces:
SSOCompatibleADUserSource, UserSourceProfile, UserSourceProfileKernel

public class ADtoDBHybridAuthenticator extends DatabaseExpertUserSource implements SSOCompatibleADUserSource
  • Constructor Details

  • Method Details

    • startup

      public void startup(UserSourceManager manager)
      Description copied from interface: UserSourceProfileKernel
      Called when the user source is created before it is used.
      Specified by:
      startup in interface UserSourceProfile
      Specified by:
      startup in interface UserSourceProfileKernel
      Overrides:
      startup in class UserSourceProfileKernelWrapper
    • newLogger

      protected LoggerEx newLogger()
      Overrides:
      newLogger in class DatabaseExpertUserSource
    • authenticate

      public AuthenticatedUser authenticate(AuthChallenge challenge) throws Exception
      Description copied from interface: UserSourceProfile
      Called to both verify authentication for a given username/password pair, and to find the security roles for that user.
      Specified by:
      authenticate in interface UserSourceProfile
      Overrides:
      authenticate in class DatabaseExpertUserSource
      Returns:
      An AuthenticatedUser that contains the user's roles if authentication succeeded, or null if it did not.
      Throws:
      PasswordExpiredException - if the user's password has expired and must be reset
      Exception - if there was an unexpected problem encountered during authentication
    • authenticateAD

      public AuthenticatedUser authenticateAD(AuthChallenge challenge) throws Exception
      Description copied from interface: SSOCompatibleADUserSource
      Callback to the standard, non-SSO version of this user source's auth logic
      Specified by:
      authenticateAD in interface SSOCompatibleADUserSource
      Throws:
      Exception
    • getUsers

      @Nonnull public Collection<User> getUsers() throws Exception
      Description copied from interface: UserSourceProfile
      Retrieve all users from this profile. This can execute slowly (block) if need be. It will be called periodically by the manager and the results will be cached. Users from failover sources will be returned if hard failover is configured and triggered.
      Specified by:
      getUsers in interface UserSourceProfile
      Overrides:
      getUsers in class DatabaseExpertUserSource
      Throws:
      Exception
    • getUser

      @Nonnull public Optional<User> getUser(String userName) throws Exception
      Description copied from interface: UserSourceProfile
      Fetch a User with the given user name. If more than one user exists with the given user name, the first user returned from the underlying data source is returned. Failover sources will be queried if hard failover is configured and the primary sources are unable to fetch the user due to an error. Failover sources will also be queried if soft failover is configured and the user is not found in the primary sources.
      Specified by:
      getUser in interface UserSourceProfile
      Overrides:
      getUser in class DatabaseExpertUserSource
      Parameters:
      userName - the user name of the User to fetch
      Returns:
      an Optional User with the given user name. the user may be from a failover user source (check User.getProfileName() to confirm)
      Throws:
      Exception - if there is an unexpected problem fetching the user with the given user name
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class DatabaseExpertUserSource
    • setListUsersFromAD

      public void setListUsersFromAD(boolean listUsersFromAD)
    • setUserPropsQuery

      public void setUserPropsQuery(String userPropsQuery)
    • setLdapHost

      public void setLdapHost(String ldapHost)
    • setLdapPort

      public void setLdapPort(String ldapPort)
    • setSecondaryLdapHost

      public void setSecondaryLdapHost(String secondaryLdapHost)
    • setSecondaryLdapPort

      public void setSecondaryLdapPort(String secondaryLdapPort)
    • setUsernamePrefix

      public void setUsernamePrefix(String usernamePrefix)
    • setUsernameSuffix

      public void setUsernameSuffix(String usernameSuffix)
    • setProfileUsername

      public void setProfileUsername(String profileUsername)
    • setReadTimeOut

      public void setReadTimeOut(Long readTimeOut)
    • setProfilePassword

      public void setProfilePassword(String profilePassword)
    • setUsePrefixAndSuffixForGatewayUser

      public void setUsePrefixAndSuffixForGatewayUser(boolean usePrefixAndSuffixForGatewayUser)
    • setUseSSL

      public void setUseSSL(boolean useSsl)
    • setAllowAnon

      public void setAllowAnon(boolean anon)
    • setSecurityAuthentication

      public void setSecurityAuthentication(LDAPHelper.AuthType securityAuthentication)
    • setSecurityProtocol

      public void setSecurityProtocol(LDAPHelper.ProtocolType securityProtocol)
    • setUserSearchBase

      public void setUserSearchBase(String userSearchBase)
    • setUserSearchFilter

      public void setUserSearchFilter(String userSearchFilter)
    • setUserListFilter

      public void setUserListFilter(String userListFilter)
    • setUserNameAttribute

      public void setUserNameAttribute(String userNameAttribute)
    • setPageSize

      public void setPageSize(int size)
    • setSSOEnabled

      public void setSSOEnabled(boolean enabled)
    • setSSODomain

      public void setSSODomain(String ssoDomain)
    • setSaslConfig

      public void setSaslConfig(SASLConfig saslConfig)
    • setReferral

      public void setReferral(LDAPHelper.ReferralType referral)
    • findSSOUser

      public User findSSOUser(String uname) throws Exception
      Description copied from interface: SSOCompatibleADUserSource
      Used by the SSO helper in order to search for a user with a given username. Return null if no user with this username is found.
      Specified by:
      findSSOUser in interface SSOCompatibleADUserSource
      Throws:
      Exception