Class ADInternalHybridUserSource

All Implemented Interfaces:
SSOCompatibleADUserSource, UserSourceProfile, UserSourceProfileKernel

public class ADInternalHybridUserSource extends InternalUserSource 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
    • findUserInternalId

      protected Long findUserInternalId(PersistenceSession session, User user)
      Our superclass stores the internal user id as the User object's id, but we don't. We store the username as the ID. This function looks up the internal database id of a user for the superclass's benefit.
      Overrides:
      findUserInternalId in class InternalUserSource
    • alterUser

      public void alterUser(User user, UICallback ui) throws Exception
      Specified by:
      alterUser in interface UserSourceProfile
      Overrides:
      alterUser in class InternalUserSource
      Throws:
      Exception
    • 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 InternalUserSource
      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
    • 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 InternalUserSource
      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 InternalUserSource
      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:
    • 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
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class InternalUserSource
    • setPopulateUsersOnDemand

      public void setPopulateUsersOnDemand(boolean populateUsersOnDemand)
    • setListUsersFromAD

      public void setListUsersFromAD(boolean listUsersFromAD)
    • 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)
    • setFullNameAttribute

      public void setFullNameAttribute(String fullNameAttribute)
    • setEmailAttribute

      public void setEmailAttribute(String emailAttribute)
    • setPhoneAttribute

      public void setPhoneAttribute(String phoneAttribute)
    • setSmsAttribute

      public void setSmsAttribute(String smsAttribute)
    • 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)
    • getEditFlags

      public Set<UserSourceEditCapability> getEditFlags()
      Description copied from interface: UserSourceProfile
      Which of the editing functions are supported?
      Specified by:
      getEditFlags in interface UserSourceProfile
      Overrides:
      getEditFlags in class InternalUserSource