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 AuthenticatedUser
authenticate(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 PropertySet
findExtraProps(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 SRConnection
getConnection()
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 LoggerEx
newLogger()
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.void
setAuthenticateBadgeQuery(java.lang.String authenticateBadgeQuery)
void
setAuthenticateQuery(java.lang.String string)
void
setDatasource(long id)
void
setListContactInfoQuery(java.lang.String listContactInfoQuery)
void
setListExtraPropsQuery(java.lang.String listExtraPropsQuery)
void
setListRolesQuery(java.lang.String string)
void
setListScheduleAdjustmentsQuery(java.lang.String listScheduleAdjustmentsQuery)
void
setListUserRolesQuery(java.lang.String string)
void
setListUsersQuery(java.lang.String listUsersQuery)
java.lang.String
toString()
-
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:UserSourceProfile
Called 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: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.- Throws:
java.lang.Exception
-
getEditFlags
public java.util.Set<UserSourceEditCapability> getEditFlags()
Description copied from interface:UserSourceProfile
Which of the editing functions are supported?- Specified by:
getEditFlags
in interfaceUserSourceProfile
- Overrides:
getEditFlags
in 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:
toString
in classjava.lang.Object
-
-