Package de.fraunhofer.iese.mydata.user
Interface ITokenService
-
- All Known Subinterfaces:
IManagementService
public interface ITokenService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete(String token)PasswordResetTokengenerateToken(String username)Generate a token for the given userPasswordResetTokengetToken(String token)PasswordResetTokengetTokenForUser(User user)voidvalidateToken(String userId, String token)Validate the tokenvoidvalidateTokenAndSetPassword(String userId, String token, String newPassword)
-
-
-
Method Detail
-
generateToken
PasswordResetToken generateToken(String username) throws IOException, NoSuchEntityException
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 exist
-
getToken
PasswordResetToken getToken(String token)
-
getTokenForUser
PasswordResetToken getTokenForUser(User user)
-
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
-
delete
void delete(String token)
-
-