Java 8 CredentialExpiredException - 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 CredentialExpiredException class.

This code example shows how to use the following methods:
    static { 
        DEFAULT_USERNAME_ERROR_MAP.put("accountDisabled", new AccountDisabledException("Account disabled"));
        DEFAULT_USERNAME_ERROR_MAP.put("accountLocked", new AccountLockedException("Account locked"));
        DEFAULT_USERNAME_ERROR_MAP.put("badHours", new InvalidLoginTimeException("Invalid logon hours"));
        DEFAULT_USERNAME_ERROR_MAP.put("badWorkstation", new InvalidLoginLocationException("Invalid workstation"));
        DEFAULT_USERNAME_ERROR_MAP.put("passwordExpired", new CredentialExpiredException("Password expired"));
    } 
 
    public SimpleTestUsernamePasswordAuthenticationHandler() { 
        logger.warn( 
                "{} is only to be used in a testing environment.  NEVER enable this in a production environment.", 
                getName()); 
    } 
 
    public void setUsernameErrorMap(final Map<String, Exception> map) {
        this.usernameErrorMap = map;
    } 
 
    @Override 
    public HandlerResult authenticate(final Credential credential)
4
CodeRank
This code example shows how to use the following methods:
  } 
 
  private static void checkPasswordExpiration( final User user ) throws CredentialExpiredException {
    if ( Objects.firstNonNull( user.getPasswordExpires(), Long.MAX_VALUE )
        < System.currentTimeMillis() ) {
      throw new CredentialExpiredException();
    } 
  } 
 
} 
3
CodeRank
See Code Examples for Java 8 CredentialExpiredException Methods: