*/
public void activateUser(IdpUser user) throws UserNotFoundException {
IdpUser foundUser = em.find(IdpUser.class, user.getId());
if (foundUser == null) {
log.error("Error activating user. User {} not found.", user.getUsername());
throw new UserNotFoundException("Error activating user. User " + user.getUsername() + "not found.");
}
foundUser.setStatus(IdpUserState.ACTIVE);
foundUser.setActionToken("");
em.persist(foundUser);
log.info("Activated user with username {}.", foundUser.getUsername());