Package ch.tocco.nice2.userbase.api
Interface PrincipalService
- All Known Subinterfaces:
PrincipalManagerService
- All Known Implementing Classes:
PrincipalManagerImpl
public interface PrincipalService
Data access interface for the "Principal" entity.
-
Method Summary
Modifier and TypeMethodDescriptioncreateUniqueUsernames
(List<Entity> users) Creates a uniqueusername
.getPrincipalEntity
(String username) getUserEntity
(String username) void
loginNewlyCreatedUser
(Entity userEntity) Logs in a (newly created) user.void
Logs in a user by username.void
resetPrincipalFields
(Entity principal, PrincipalFields... fields) void
resetPrincipalFields
(String username, PrincipalFields... fields) void
resetTemporaryPassword
(String username) Invalidates the state of the temporary password request mechanism, resettingtemporary_password
tonull
and setting the flag requiring a new password after login tofalse
.void
setNewPassword
(String username, String newpassword, boolean resetRequired) Sets new password and required-flag.void
setTemporaryPassword
(String username, String newpassword) Sets thetemporary_password
for the given principal, which will be valid for login as well until it expires based on thelast_password_dispatch
.void
updatePrincipalFields
(Entity principal, PrincipalFields... fields) void
updatePrincipalFields
(String username, PrincipalFields... fields)
-
Method Details
-
setNewPassword
Sets new password and required-flag.- Parameters:
username
- the name of the principal to set new password tonewpassword
- the new password to setresetRequired
- value of require-new-password flag
-
setTemporaryPassword
Sets thetemporary_password
for the given principal, which will be valid for login as well until it expires based on thelast_password_dispatch
.- Parameters:
username
- the name of the principalnewpassword
- thetemporary_password
-
resetTemporaryPassword
Invalidates the state of the temporary password request mechanism, resettingtemporary_password
tonull
and setting the flag requiring a new password after login tofalse
.- Parameters:
username
- the name of the principal to modify
-
updatePrincipalFields
-
resetPrincipalFields
-
updatePrincipalFields
-
resetPrincipalFields
-
getCurrentPrincipal
-
getCurrentUser
-
getPrincipalEntity
-
getUserEntity
-
loginNewlyCreatedUser
Logs in a (newly created) user. Takes the related principal (only supported with one principal!). For example used in flows where new users (and thus logins) are created. Use with care! -
loginUser
Logs in a user by username. Use with care! -
createUniqueUsernames
Creates a uniqueusername
. Based on theUser
's email or firstname and lastname.
-