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) voidloginNewlyCreatedUser(Entity userEntity) Logs in a (newly created) user.voidLogs in a user by username.voidresetPrincipalFields(Entity principal, PrincipalFields... fields) voidresetPrincipalFields(String username, PrincipalFields... fields) voidresetTemporaryPassword(String username) Invalidates the state of the temporary password request mechanism, resettingtemporary_passwordtonulland setting the flag requiring a new password after login tofalse.voidsetNewPassword(String username, String newpassword, boolean resetRequired) Sets new password and required-flag.voidsetTemporaryPassword(String username, String newpassword) Sets thetemporary_passwordfor the given principal, which will be valid for login as well until it expires based on thelast_password_dispatch.voidupdatePrincipalFields(Entity principal, PrincipalFields... fields) voidupdatePrincipalFields(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_passwordfor 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_passwordtonulland 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.
-