Package javax.security.sasl

Examples of javax.security.sasl.AuthenticationException


  @Override
  public void Authenticate(String user, String  password)
      throws AuthenticationException {

    if (pamServiceNames == null || pamServiceNames.trim().isEmpty()) {
      throw new AuthenticationException("No PAM services are set.");
    }

    String pamServices[] = pamServiceNames.split(",");
    for (String pamService : pamServices) {
      Pam pam = new Pam(pamService);
      boolean isAuthenticated = pam.authenticateSuccessful(user, password);
      if (!isAuthenticated) {
        throw new AuthenticationException("Error authenticating with the PAM service: " + pamService);
      }
    }
  }
View Full Code Here


    } else if (authMethod.equals(AuthMethods.CUSTOM)) {
      return new CustomAuthenticationProviderImpl();
    } else if (authMethod.equals(AuthMethods.NONE)) {
      return new AnonymousAuthenticationProviderImpl();
    } else {
      throw new AuthenticationException("Unsupported authentication method");
    }
  }
View Full Code Here

    try {
      // Create initial context
      DirContext ctx = new InitialDirContext(env);
      ctx.close();
    } catch (NamingException e) {
      throw new AuthenticationException("Error validating LDAP user");
    }
  return;
  }
View Full Code Here

            HashMap<String, String> directivesMap, String directive,
            boolean mandatory) throws AuthenticationException {
        String value = directivesMap.get(directive);
        if (value == null) {
            if (mandatory) {
                throw new AuthenticationException("\"" + directive
                        + "\" mandatory directive is missing");
            }

            return "";
        }
View Full Code Here

TOP

Related Classes of javax.security.sasl.AuthenticationException

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.