Package de.fraunhofer.iese.mydata.user
Interface ITokenService
- All Known Subinterfaces:
IManagementService
public interface ITokenService
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteToken(String token) voiddeleteTokenByUserUuid(String userUuid) generateToken(String username) Generate a token for the given usergetTokenForUser(User user) voidvalidateToken(String userId, String token) Validate the tokenvoidvalidateTokenAndSetPassword(String userId, String token, String newPassword)
-
Method Details
-
generateToken
PasswordResetToken generateToken(String username) throws IOException, NoSuchEntityException, ForbiddenException Generate a token for the given user- Parameters:
username- The user for whom the token will be created- Returns:
- the password reset token
- Throws:
IOExceptionNoSuchEntityException- if the user does not existForbiddenException- if the maximum number of allowed password requests has been reached
-
getToken
-
getTokenForUser
-
validateToken
void validateToken(String userId, String token) throws IOException, ForbiddenException, NoSuchEntityException Validate the token- Parameters:
userId- The id of the user for whom the token will be validatedtoken- the token in string format- Throws:
IOExceptionForbiddenException- If the token is not valid for this userNoSuchEntityException- if the token or the user does not exist
-
validateTokenAndSetPassword
void validateTokenAndSetPassword(String userId, String token, String newPassword) throws IOException, ForbiddenException, NoSuchEntityException, ResourceUpdateException, MessagingException -
deleteToken
-
deleteTokenByUserUuid
- Throws:
IOExceptionNoSuchEntityException
-