Package de.fraunhofer.iese.mydata.user
Interface ITokenService
- All Known Subinterfaces:
IManagementService
public interface ITokenService
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteToken
(String token) void
deleteTokenByUserUuid
(String userUuid) generateToken
(String username) Generate a token for the given usergetTokenForUser
(User user) void
validateToken
(String userId, String token) Validate the tokenvoid
validateTokenAndSetPassword
(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:
IOException
NoSuchEntityException
- 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:
IOException
ForbiddenException
- 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:
IOException
NoSuchEntityException
-