Class DatabaseExpertUserSource
- java.lang.Object
-
- com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
-
- com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
-
- com.inductiveautomation.ignition.gateway.authentication.impl.DatabaseExpertUserSource
-
- All Implemented Interfaces:
UserSourceProfile,UserSourceProfileKernel
- Direct Known Subclasses:
ADtoDBHybridAuthenticator
public class DatabaseExpertUserSource extends AbstractUserSourceProfile
This Authenticator uses a database and SQL queries to authenticate users and retrieve roles
-
-
Field Summary
-
Fields inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
PWD_EXPIRATION_BYPASS
-
-
Constructor Summary
Constructors Constructor Description DatabaseExpertUserSource(UserSourceProfileKernel kernel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthenticatedUserauthenticate(AuthChallenge challenge)Called to both verify authentication for a given username/password pair, and to find the security roles for that user.protected java.util.List<ContactInfo>findContactInfo(SRConnection con, java.lang.String uname)protected PropertySetfindExtraProps(SRConnection con, java.lang.String uname)protected java.util.List<java.lang.String>findRoles(java.sql.Connection con, java.lang.String uname)protected java.util.List<ScheduleAdjustment>findScheduleAdjustment(SRConnection con, java.lang.String uname)protected SRConnectiongetConnection()java.util.Set<UserSourceEditCapability>getEditFlags()Which of the editing functions are supported?@NotNull java.util.Collection<java.lang.String>getRoles()@NotNull java.util.Collection<User>getUsers()Retrieve all users from this profile.protected LoggerExnewLogger()protected voidset(User user, Property<java.lang.String> prop, Dataset dataset, java.lang.String colName)Tries to extract information out of the dataset at row zero.voidsetAuthenticateBadgeQuery(java.lang.String authenticateBadgeQuery)voidsetAuthenticateQuery(java.lang.String string)voidsetDatasource(long id)voidsetListContactInfoQuery(java.lang.String listContactInfoQuery)voidsetListExtraPropsQuery(java.lang.String listExtraPropsQuery)voidsetListRolesQuery(java.lang.String string)voidsetListScheduleAdjustmentsQuery(java.lang.String listScheduleAdjustmentsQuery)voidsetListUserRolesQuery(java.lang.String string)voidsetListUsersQuery(java.lang.String listUsersQuery)java.lang.StringtoString()-
Methods inherited from class com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
addRole, addUser, alterPassword, alterUser, getName, getUser, removeRole, removeUser, renameRole
-
Methods inherited from class com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
getCacheValidationTimeout, getContext, getManager, getProfileId, getProfileName, isLockedOut, notifyFailedAttempt, shutdown, startup
-
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, startup, validatePassword
-
-
-
-
Constructor Detail
-
DatabaseExpertUserSource
public DatabaseExpertUserSource(UserSourceProfileKernel kernel)
-
-
Method Detail
-
newLogger
protected LoggerEx newLogger()
-
set
protected void set(User user, Property<java.lang.String> prop, Dataset dataset, java.lang.String colName)
Tries to extract information out of the dataset at row zero. If the column doesn't exist, fails silently
-
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.- Returns:
- An AuthenticatedUser that contains the user's roles if authentication succeeded, or null if it did not.
- Throws:
java.lang.Exception
-
findRoles
@Nonnull protected java.util.List<java.lang.String> findRoles(java.sql.Connection con, java.lang.String uname) throws java.lang.Exception- Throws:
java.lang.Exception
-
findContactInfo
@Nonnull protected java.util.List<ContactInfo> findContactInfo(SRConnection con, java.lang.String uname) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findScheduleAdjustment
protected java.util.List<ScheduleAdjustment> findScheduleAdjustment(SRConnection con, java.lang.String uname) throws java.lang.Exception
- Throws:
java.lang.Exception
-
findExtraProps
protected PropertySet findExtraProps(SRConnection con, java.lang.String uname) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getUsers
@NotNull public @NotNull 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.- Throws:
java.lang.Exception
-
getEditFlags
public java.util.Set<UserSourceEditCapability> getEditFlags()
Description copied from interface:UserSourceProfileWhich of the editing functions are supported?- Specified by:
getEditFlagsin interfaceUserSourceProfile- Overrides:
getEditFlagsin classAbstractUserSourceProfile
-
getRoles
@NotNull @Nonnull public @NotNull java.util.Collection<java.lang.String> getRoles() throws java.lang.Exception- Returns:
- a collection of all possible role names for this profile. May be empty
- Throws:
java.lang.Exception
-
getConnection
protected SRConnection getConnection() throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
setDatasource
public void setDatasource(long id)
-
setAuthenticateQuery
public void setAuthenticateQuery(java.lang.String string)
-
setAuthenticateBadgeQuery
public void setAuthenticateBadgeQuery(java.lang.String authenticateBadgeQuery)
-
setListRolesQuery
public void setListRolesQuery(java.lang.String string)
-
setListUserRolesQuery
public void setListUserRolesQuery(java.lang.String string)
-
setListExtraPropsQuery
public void setListExtraPropsQuery(java.lang.String listExtraPropsQuery)
-
setListContactInfoQuery
public void setListContactInfoQuery(java.lang.String listContactInfoQuery)
-
setListScheduleAdjustmentsQuery
public void setListScheduleAdjustmentsQuery(java.lang.String listScheduleAdjustmentsQuery)
-
setListUsersQuery
public void setListUsersQuery(java.lang.String listUsersQuery)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-