class AuthenticationServiceImpl implements AuthenticationService {

  @Override
  public String validate(String token) {
    try {
      return tokenStore.parse(token);
    } catch (TokenException e) {
      throw new UnauthorizedAccessException("No user matches such a token " + token, e);
    }
  }

    AuthenticationServiceImpl(
      TokenStore tokenStore,
      UserRepository userRepository);

}