Class ADInternalHybridUserSource
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
-
- com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
-
- com.inductiveautomation.ignition.gateway.authentication.impl.InternalUserSource
-
- com.inductiveautomation.ignition.gateway.authentication.impl.ADInternalHybridUserSource
-
- All Implemented Interfaces:
SSOCompatibleADUserSource,UserSourceProfile,UserSourceProfileKernel
public class ADInternalHybridUserSource extends InternalUserSource implements SSOCompatibleADUserSource
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
PWD_EXPIRATION_BYPASS
-
-
Constructor Summary
Constructors Constructor Description ADInternalHybridUserSource(UserSourceProfileKernel kernel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidalterUser(User user, UICallback ui)AuthenticatedUserauthenticate(AuthChallenge challenge)Called to both verify authentication for a given username/password pair, and to find the security roles for that user.AuthenticatedUserauthenticateAD(AuthChallenge challenge)Callback to the standard, non-SSO version of this user source's auth logicUserfindSSOUser(java.lang.String uname)Used by the SSO helper in order to search for a user with a given username.protected java.lang.LongfindUserInternalId(PersistenceSession session, User user)Our superclass stores the internal user id as the User object's id, but we don't.java.util.Set<UserSourceEditCapability>getEditFlags()Which of the editing functions are supported?java.util.Optional<User>getUser(java.lang.String userName)Fetch aUserwith the given user name.java.util.Collection<User>getUsers()Retrieve all users from this profile.voidsetAllowAnon(boolean anon)voidsetEmailAttribute(java.lang.String emailAttribute)voidsetFullNameAttribute(java.lang.String fullNameAttribute)voidsetLdapHost(java.lang.String ldapHost)voidsetLdapPort(java.lang.String ldapPort)voidsetListUsersFromAD(boolean listUsersFromAD)voidsetPageSize(int size)voidsetPhoneAttribute(java.lang.String phoneAttribute)voidsetPopulateUsersOnDemand(boolean populateUsersOnDemand)voidsetProfilePassword(java.lang.String profilePassword)voidsetProfileUsername(java.lang.String profileUsername)voidsetReadTimeout(java.lang.Long readTimeOut)voidsetReferral(LDAPHelper.ReferralType referral)voidsetSaslConfig(SASLConfig saslConfig)voidsetSecondaryLdapHost(java.lang.String secondaryLdapHost)voidsetSecondaryLdapPort(java.lang.String secondaryLdapPort)voidsetSecurityAuthentication(LDAPHelper.AuthType securityAuthentication)voidsetSecurityProtocol(LDAPHelper.ProtocolType securityProtocol)voidsetSmsAttribute(java.lang.String smsAttribute)voidsetSSODomain(java.lang.String ssoDomain)voidsetSSOEnabled(boolean enabled)voidsetUserListFilter(java.lang.String userListFilter)voidsetUserNameAttribute(java.lang.String userNameAttribute)voidsetUsernamePrefix(java.lang.String usernamePrefix)voidsetUsernameSuffix(java.lang.String usernameSuffix)voidsetUserSearchBase(java.lang.String userSearchBase)voidsetUserSearchFilter(java.lang.String userSearchFilter)voidsetUseSSL(boolean useSsl)voidstartup(UserSourceManager manager)Called when the user source is created before it is used.java.lang.StringtoString()-
Methods inherited from class com.inductiveautomation.ignition.gateway.authentication.impl.InternalUserSource
addRole, addUser, addUserInternal, alterPassword, createDefaultUserSource, createFirstUser, findInternalUser, getRoles, removeRole, removeUser, renameRole, validatePassword
-
Methods inherited from class com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
getName, getRoles, getUser, getUsers
-
Methods inherited from class com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
getCacheValidationTimeout, getContext, getManager, getProfileId, getProfileName, isLockedOut, notifyFailedAttempt, shutdown
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
getCacheValidationTimeout, getProfileId, shutdown
-
-
-
-
Constructor Detail
-
ADInternalHybridUserSource
public ADInternalHybridUserSource(UserSourceProfileKernel kernel)
-
-
Method Detail
-
startup
public void startup(UserSourceManager manager)
Description copied from interface:UserSourceProfileKernelCalled when the user source is created before it is used.- Specified by:
startupin interfaceUserSourceProfile- Specified by:
startupin interfaceUserSourceProfileKernel- Overrides:
startupin classUserSourceProfileKernelWrapper
-
findUserInternalId
protected java.lang.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:
findUserInternalIdin classInternalUserSource
-
alterUser
public void alterUser(User user, UICallback ui) throws java.lang.Exception
- Specified by:
alterUserin interfaceUserSourceProfile- Overrides:
alterUserin classInternalUserSource- Throws:
java.lang.Exception
-
authenticate
public AuthenticatedUser authenticate(AuthChallenge challenge) throws java.lang.Exception
Description copied from interface:UserSourceProfileCalled to both verify authentication for a given username/password pair, and to find the security roles for that user.- Specified by:
authenticatein interfaceUserSourceProfile- Overrides:
authenticatein classInternalUserSource- Returns:
- An AuthenticatedUser that contains the user's roles if authentication succeeded, or null if it did not.
- Throws:
java.lang.Exception
-
getUsers
@Nonnull public java.util.Collection<User> getUsers() throws java.lang.Exception
Description copied from interface:UserSourceProfileRetrieve 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:
getUsersin interfaceUserSourceProfile- Overrides:
getUsersin classInternalUserSource- Throws:
java.lang.Exception
-
getUser
@Nonnull public java.util.Optional<User> getUser(java.lang.String userName) throws java.lang.Exception
Description copied from interface:UserSourceProfileFetch aUserwith 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:
getUserin interfaceUserSourceProfile- Overrides:
getUserin classInternalUserSource- Parameters:
userName- the user name of theUserto fetch- Returns:
- an
OptionalUserwith the given user name. the user may be from a failover user source (checkUser.getProfileName()to confirm) - Throws:
java.lang.Exception- if there is an unexpected problem fetching the user with the given user name- See Also:
UserSourceProfile.getUser(String, String)
-
authenticateAD
public AuthenticatedUser authenticateAD(AuthChallenge challenge) throws java.lang.Exception
Description copied from interface:SSOCompatibleADUserSourceCallback to the standard, non-SSO version of this user source's auth logic- Specified by:
authenticateADin interfaceSSOCompatibleADUserSource- Throws:
java.lang.Exception
-
findSSOUser
public User findSSOUser(java.lang.String uname) throws java.lang.Exception
Description copied from interface:SSOCompatibleADUserSourceUsed 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:
findSSOUserin interfaceSSOCompatibleADUserSource- Throws:
java.lang.Exception
-
toString
public java.lang.String toString()
- Overrides:
toStringin classInternalUserSource
-
setPopulateUsersOnDemand
public void setPopulateUsersOnDemand(boolean populateUsersOnDemand)
-
setListUsersFromAD
public void setListUsersFromAD(boolean listUsersFromAD)
-
setLdapHost
public void setLdapHost(java.lang.String ldapHost)
-
setLdapPort
public void setLdapPort(java.lang.String ldapPort)
-
setSecondaryLdapHost
public void setSecondaryLdapHost(java.lang.String secondaryLdapHost)
-
setSecondaryLdapPort
public void setSecondaryLdapPort(java.lang.String secondaryLdapPort)
-
setUsernamePrefix
public void setUsernamePrefix(java.lang.String usernamePrefix)
-
setUsernameSuffix
public void setUsernameSuffix(java.lang.String usernameSuffix)
-
setProfileUsername
public void setProfileUsername(java.lang.String profileUsername)
-
setReadTimeout
public void setReadTimeout(java.lang.Long readTimeOut)
-
setProfilePassword
public void setProfilePassword(java.lang.String profilePassword)
-
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(java.lang.String userSearchBase)
-
setUserSearchFilter
public void setUserSearchFilter(java.lang.String userSearchFilter)
-
setUserListFilter
public void setUserListFilter(java.lang.String userListFilter)
-
setUserNameAttribute
public void setUserNameAttribute(java.lang.String userNameAttribute)
-
setFullNameAttribute
public void setFullNameAttribute(java.lang.String fullNameAttribute)
-
setEmailAttribute
public void setEmailAttribute(java.lang.String emailAttribute)
-
setPhoneAttribute
public void setPhoneAttribute(java.lang.String phoneAttribute)
-
setSmsAttribute
public void setSmsAttribute(java.lang.String smsAttribute)
-
setPageSize
public void setPageSize(int size)
-
setSSOEnabled
public void setSSOEnabled(boolean enabled)
-
setSSODomain
public void setSSODomain(java.lang.String ssoDomain)
-
setSaslConfig
public void setSaslConfig(SASLConfig saslConfig)
-
setReferral
public void setReferral(LDAPHelper.ReferralType referral)
-
getEditFlags
public java.util.Set<UserSourceEditCapability> getEditFlags()
Description copied from interface:UserSourceProfileWhich of the editing functions are supported?- Specified by:
getEditFlagsin interfaceUserSourceProfile- Overrides:
getEditFlagsin classInternalUserSource
-
-