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 void
delete(String token)
PasswordResetToken
generateToken(String username)
Generate a token for the given userPasswordResetToken
getToken(String token)
PasswordResetToken
getTokenForUser(User user)
void
validateToken(String userId, String token)
Validate the tokenvoid
validateTokenAndSetPassword(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:
IOException
NoSuchEntityException
- 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:
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
-
delete
void delete(String token)
-
-