Class InternalUserSource
java.lang.Object
com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
com.inductiveautomation.ignition.gateway.authentication.impl.InternalUserSource
- All Implemented Interfaces:
UserSourceProfile,UserSourceProfileKernel
- Direct Known Subclasses:
ADInternalHybridUserSource
This user source stores users, roles, extended properties, and contact info inside the internal database. It is fully compliant with the user-source editing capabilities of Ignition.
-
Field Summary
Fields inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
IDENTIFIER_MDC_KEY -
Constructor Summary
ConstructorsConstructorDescriptionInternalUserSource(UserSourceProfileKernel delegate) InternalUserSource(UserSourceProfileKernel kernel, int pwdHistory, int pwdMinLength, int pwdComplexity, int pwdMaxAge, boolean pwdContainsPassword, boolean pwdContainsUserName, int pwdMaxRepeatedChars) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRole(Role role, UICallback ui) voidaddUser(User user, UICallback ui) protected voidaddUserInternal(User user, UICallback ui) voidalterPassword(User user, String oldPassword, String newPassword) voidalterRole(Role role, UICallback ui) voidalterUser(User user, UICallback ui) authenticate(AuthChallenge challenge) Called to both verify authentication for a given username/password pair, and to find the security roles for that user.findInternalUser(String uname) Looks up the internal user record keyed on username, NOT case-sensitiveprotected StringfindUserInternalId(User user) Find the internal ID of the user.protected StringGenerate a UUID for anInternalUserResource.Which of the editing functions are supported?getRoles()Fetch aUserwith the given user name.getUsers()Retrieve all users from this profile.voidremoveRole(Role role, UICallback ui) voidremoveUser(User user, UICallback ui) protected StringselectInternalUserId(InternalUserResource internalUser) Select the internal user ID from theInternalUserResource.toString()validatePassword(User user, String password) Validate the given password.Methods inherited from class com.inductiveautomation.ignition.gateway.user.AbstractUserSourceProfile
getName, getRoles, getUser, getUsersMethods inherited from class com.inductiveautomation.ignition.gateway.user.UserSourceProfileKernelWrapper
getCacheValidationTimeout, getContext, getManager, getProfileName, isLockedOut, notifyFailedAttempt, shutdown, startupMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.inductiveautomation.ignition.gateway.user.UserSourceProfile
getCacheValidationTimeout, shutdown, startup
-
Constructor Details
-
InternalUserSource
-
InternalUserSource
public InternalUserSource(UserSourceProfileKernel kernel, int pwdHistory, int pwdMinLength, int pwdComplexity, int pwdMaxAge, boolean pwdContainsPassword, boolean pwdContainsUserName, int pwdMaxRepeatedChars)
-
-
Method Details
-
authenticate
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:
PasswordExpiredException- if the user's password has expired and must be resetException- if there was an unexpected problem encountered during authentication
-
getUsers
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- Specified by:
getUsersin classAbstractUserSourceProfile- Throws:
Exception
-
findInternalUser
Looks up the internal user record keyed on username, NOT case-sensitive -
getUser
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 classAbstractUserSourceProfile- 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:
Exception- if there is an unexpected problem fetching the user with the given user name- See Also:
-
getRoles
- Specified by:
getRolesin interfaceUserSourceProfile- Specified by:
getRolesin 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
-
toString
-
getEditFlags
Description copied from interface:UserSourceProfileWhich of the editing functions are supported?- Specified by:
getEditFlagsin interfaceUserSourceProfile- Overrides:
getEditFlagsin classAbstractUserSourceProfile
-
validatePassword
Description copied from interface:UserSourceProfileValidate the given password. Note that this doesn't mean it checks to see if this password matches the user's current password. Rather, it means that this password would be an acceptable new password for the user.- Returns:
- A i18n key for the error message describing why the password is invalid, or null if the password is valid.
-
addUserInternal
- Throws:
Exception
-
generateUuid
Generate a UUID for anInternalUserResource.- Returns:
- A UUID string or null if no UUID is generated.
-
selectInternalUserId
Select the internal user ID from theInternalUserResource.- Parameters:
internalUser- The internal user resource to get the ID of.- Returns:
- The ID of the internal user.
-
addUser
- Specified by:
addUserin interfaceUserSourceProfile- Overrides:
addUserin classAbstractUserSourceProfile- Throws:
Exception
-
findUserInternalId
Find the internal ID of the user. This is used to identify the user in the JSON resource.- Parameters:
user- The user to find the ID for.- Returns:
- The internal ID of the user.
-
alterPassword
- Specified by:
alterPasswordin interfaceUserSourceProfile- Overrides:
alterPasswordin classAbstractUserSourceProfile- Throws:
Exception
-
alterUser
- Specified by:
alterUserin interfaceUserSourceProfile- Overrides:
alterUserin classAbstractUserSourceProfile- Throws:
Exception
-
removeUser
- Specified by:
removeUserin interfaceUserSourceProfile- Overrides:
removeUserin classAbstractUserSourceProfile- Throws:
Exception
-
addRole
- Specified by:
addRolein interfaceUserSourceProfile- Overrides:
addRolein classAbstractUserSourceProfile
-
alterRole
- Specified by:
alterRolein interfaceUserSourceProfile- Overrides:
alterRolein classAbstractUserSourceProfile
-
removeRole
- Specified by:
removeRolein interfaceUserSourceProfile- Overrides:
removeRolein classAbstractUserSourceProfile- Throws:
Exception
-