Package org.platformlayer.auth

Examples of org.platformlayer.auth.AuthenticatorException


    ServiceAccountEntity auth;
    try {
      auth = repository.findServiceAccount(subject, publicKey);
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while authenticating user", e);
    }

    if (auth == null) {
      log.debug("Certificate validation failed (though the caller was authenticated)");
      log.debug("Certificate validation failed - public key not recognized: " + Hex.toHex(publicKey));
View Full Code Here


    UserEntity user;
    try {
      user = (UserEntity) repository.authenticateWithPassword(username, password);
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while authenticating user", e);
    }

    if (user == null) {
      return null;
    }
View Full Code Here

  public CertificateAuthenticationResponse authenticate(CertificateAuthenticationRequest request)
      throws AuthenticatorException {
    try {
      return repository.authenticateWithCertificate(request);
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while authenticating user", e);
    }
  }
View Full Code Here

  public ProjectEntity findProject(String projectKey) throws AuthenticatorException {
    ProjectEntity project;
    try {
      project = repository.findProjectByKey(projectKey);
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while fetching project", e);
    }
    return project;
  }
View Full Code Here

  public UserEntity getUserFromToken(String userIdString, byte[] tokenSecret) throws AuthenticatorException {
    int userId;
    try {
      userId = Integer.parseInt(userIdString);
    } catch (NumberFormatException e) {
      throw new AuthenticatorException("Invalid user id", e);
    }

    if (tokenSecret.length < 1) {
      throw new IllegalArgumentException();
    }

    CryptoKey userSecret = authenticationSecrets.decryptSecretFromToken(tokenSecret);
    if (userSecret == null) {
      throw new AuthenticatorException("Authentication timed out");
    }

    UserEntity user;
    try {
      user = repository.findUserById(userId);
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while authenticating user", e);
    }

    user.unlock(userSecret);

    // user.unlockWithToken(UserEntity.TOKEN_ID_DEFAULT, tokenSecret);
View Full Code Here

      UserEntity user;
      try {
        user = repository.findUserByPublicKey(hash);
      } catch (RepositoryException e) {
        throw new AuthenticatorException("Error while authenticating user", e);
      }

      if (user != null) {
        return user;
      }
View Full Code Here

  @Override
  public UserProjectEntity findUserProject(UserEntity user, ProjectEntity project) throws AuthenticatorException {
    try {
      return repository.findUserProject(user.getId(), project.getId());
    } catch (RepositoryException e) {
      throw new AuthenticatorException("Error while querying authentication store", e);
    }

  }
View Full Code Here

TOP

Related Classes of org.platformlayer.auth.AuthenticatorException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.