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
This Authenticator uses a database and SQL queries to authenticate users and retrieve roles
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
protected static final String
Fields inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
IDENTIFIER_MDC_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionauthenticate
(AuthChallenge challenge) Called to both verify authentication for a given username/password pair, and to find the security roles for that user.protected List<ContactInfo>
findContactInfo
(SRConnection con, String uname) protected PropertySet
findExtraProps
(SRConnection con, String uname) findRoles
(Connection con, String uname) protected List<ScheduleAdjustment>
findScheduleAdjustment
(SRConnection con, String uname) protected SRConnection
getRoles()
Fetch aUser
with the given user name.getUser
(String userName, SRConnection con) getUsers()
Retrieve all users from this profile.protected Collection<User>
getUsers
(SRConnection con) protected void
Tries to extract information out of the dataset at row zero.void
setAuthenticateBadgeQuery
(String authenticateBadgeQuery) void
setAuthenticateQuery
(String string) void
setDatasource
(String datasource) void
setFindUserQuery
(String findUserQuery) void
setListContactInfoQuery
(String listContactInfoQuery) void
setListExtraPropsQuery
(String listExtraPropsQuery) void
setListRolesQuery
(String string) void
setListScheduleAdjustmentsQuery
(String listScheduleAdjustmentsQuery) void
setListUserRolesQuery
(String string) void
setListUsersQuery
(String listUsersQuery) toString()
Methods inherited from class com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
addRole, addUser, alterPassword, alterRole, alterUser, getEditFlags, getName, getRoles, getUser, getUsers, removeRole, removeUser
Methods inherited from class com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
getCacheValidationTimeout, getContext, getManager, 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, shutdown, startup, validatePassword
-
Field Details
-
COL_USERNAME
- See Also:
-
COL_FIRST_NAME
- See Also:
-
COL_LAST_NAME
- See Also:
-
COL_SCHEDULE
- See Also:
-
COL_LANGUAGE
- See Also:
-
COL_NOTES
- See Also:
-
COL_BADGE
- See Also:
-
COL_USER_UUID
- See Also:
-
-
Constructor Details
-
DatabaseExpertUserSource
-
-
Method Details
-
set
Tries to extract information out of the dataset at row zero. If the column doesn't exist, fails silently -
authenticate
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:
PasswordExpiredException
- if the user's password has expired and must be resetException
- if there was an unexpected problem encountered during authentication
-
findRoles
- Throws:
Exception
-
findContactInfo
-
findScheduleAdjustment
protected List<ScheduleAdjustment> findScheduleAdjustment(SRConnection con, String uname) throws Exception - Throws:
Exception
-
findExtraProps
- Throws:
Exception
-
getUsers
- Throws:
Exception
-
getUsers
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 interfaceUserSourceProfile
- Specified by:
getUsers
in classAbstractUserSourceProfile
- Throws:
Exception
-
getUser
- Throws:
Exception
-
getUser
Description copied from interface:UserSourceProfile
Fetch aUser
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 interfaceUserSourceProfile
- Overrides:
getUser
in classAbstractUserSourceProfile
- Parameters:
userName
- the user name of theUser
to fetch- Returns:
- an
Optional
User
with the given user name. the user may be from a failover user source (checkUser.getProfileName()
to confirm) - Throws:
Exception
- if there is an unexpected problem fetching the user with the given user name- See Also:
-
getRoles
- Specified by:
getRoles
in interfaceUserSourceProfile
- Specified by:
getRoles
in classAbstractUserSourceProfile
- Returns:
- a collection of all possible roles for this profile. May be empty. Roles from failover sources will be returned if hard failover is configured and triggered.
- Throws:
Exception
-
getConnection
- Throws:
SQLException
-
setDatasource
-
setAuthenticateQuery
-
setAuthenticateBadgeQuery
-
setListRolesQuery
-
setListUserRolesQuery
-
setListExtraPropsQuery
-
setListContactInfoQuery
-
setListScheduleAdjustmentsQuery
-
setFindUserQuery
-
setListUsersQuery
-
toString
-