Java 8 AuthenticationException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 AuthenticationException class.

This code example shows how to use the following methods:
    try { 
      // Create initial context 
      Context ctx = new InitialDirContext(env);
      ctx.close();
    } catch (NamingException e) {
      throw new AuthenticationException("Error validating LDAP user", e);
    } 
  } 
 
  private boolean hasDomain(String userName) {
    return (ServiceUtils.indexOfDomainMatch(userName) > 0);
  } 
} 
5
CodeRank
This code example shows how to use the following methods:
 
      if(!userMap.containsKey(user)){
        throw new AuthenticationException("Invalid user : "+user);
      } 
      if(!userMap.get(user).equals(password)){
        throw new AuthenticationException("Invalid passwd : "+password);
      } 
    } 
  } 
} 
5
CodeRank
This code example shows how to use the following methods:
            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 ""; 
        } 
 
        return value;
    } 
 
    /** 
     * Copy the directive to the {@link StringBuilder} if not null. 
     * (A directive is a parameter of the digest authentication process.) 
     *  
     * @param directives the directives map 
3
CodeRank
See Code Examples for Java 8 AuthenticationException Methods: