Package org.openhab.core.auth
Class ManagedUser
java.lang.Object
org.openhab.core.auth.ManagedUser
- All Implemented Interfaces:
Principal,User,Identifiable<String>
A
User sourced from a managed UserProvider.- Author:
- Yannick Schaus - initial contribution
-
Constructor Summary
ConstructorsConstructorDescriptionManagedUser(String name, String passwordSalt, String passwordHash) Constructs a user with a password hash and salt provided by the caller. -
Method Summary
Modifier and TypeMethodDescriptionGets the long-term API tokens for this usergetName()Gets the password hash.Gets the password salt.@Nullable PendingTokenGets the pending token information for this user, if any.getRoles()Gets the roles attributed to the user.Gets the current persistent sessions for this user.getUID()Get the unique identifier.voidsetApiTokens(List<UserApiToken> apiTokens) Replaces the list of API tokens by a new one.voidAlters the user's account namevoidsetPasswordHash(String passwordHash) Alters the password hash.voidsetPasswordSalt(String passwordSalt) Alters the password salt.voidsetPendingToken(@Nullable PendingToken pendingToken) Sets or clears the pending token information for this user.voidAlters the user's set of roles.voidsetSessions(List<UserSession> sessions) Replaces the list of sessions by a new one.toString()
-
Constructor Details
-
ManagedUser
Constructs a user with a password hash and salt provided by the caller.- Parameters:
name- the username (account name)passwordSalt- the salt to compute the password hashpasswordHash- the result of the hashing of the salted password
-
-
Method Details
-
getPasswordHash
Gets the password hash.- Returns:
- the password hash
-
setPasswordSalt
Alters the password salt.- Parameters:
passwordSalt- the new password salt
-
setPasswordHash
Alters the password hash.- Parameters:
passwordHash- the new password hash
-
getPasswordSalt
Gets the password salt.- Returns:
- the password salt
-
getName
-
setName
Alters the user's account name- Parameters:
name- the new account name
-
getUID
Description copied from interface:IdentifiableGet the unique identifier.- Specified by:
getUIDin interfaceIdentifiable<String>- Returns:
- the unique identifier
-
getRoles
Description copied from interface:UserGets the roles attributed to the user. -
setRoles
Alters the user's set of roles.- Parameters:
roles- the new roles
-
getPendingToken
Gets the pending token information for this user, if any.- Returns:
- the pending token information or null if there is none
-
setPendingToken
Sets or clears the pending token information for this user.- Parameters:
pendingToken- the pending token information or null to clear it
-
getSessions
Gets the current persistent sessions for this user.- Returns:
- the list of sessions
-
setSessions
Replaces the list of sessions by a new one.- Parameters:
sessions- the new list of sessions
-
getApiTokens
Gets the long-term API tokens for this user- Returns:
- the API tokens
-
setApiTokens
Replaces the list of API tokens by a new one.- Parameters:
apiTokens- the new API tokens
-
toString
-