@Override public void throwSecurityException() throws LoginException { throw new CredentialExpiredException(name()); } }
@Override public void throwSecurityException() throws LoginException { throw new CredentialExpiredException(name()); } }
@Override public void throwSecurityException() throws LoginException { throw new CredentialExpiredException(name()); } }
public static void handle(final AuthenticationStatus status, final String userId) throws LoginException { switch (status) { case FAILED: throw new FailedLoginException("Wrong username or password."); case CREDENTIAL_EXPIRED: throw new CredentialExpiredException("User: '" + userId + "'"); case ACCOUNT_EXPIRED: throw new AccountExpiredException("User: '" + userId + "'"); } }
/** * Instantiates a new account state handler, that populates * the error map with LDAP error codes and corresponding exceptions. */ public DefaultAccountStateHandler() { this.errorMap = new HashMap<>(); this.errorMap.put(ActiveDirectoryAccountState.Error.ACCOUNT_DISABLED, new AccountDisabledException()); this.errorMap.put(ActiveDirectoryAccountState.Error.ACCOUNT_LOCKED_OUT, new AccountLockedException()); this.errorMap.put(ActiveDirectoryAccountState.Error.INVALID_LOGON_HOURS, new InvalidLoginTimeException()); this.errorMap.put(ActiveDirectoryAccountState.Error.INVALID_WORKSTATION, new InvalidLoginLocationException()); this.errorMap.put(ActiveDirectoryAccountState.Error.PASSWORD_MUST_CHANGE, new AccountPasswordMustChangeException()); this.errorMap.put(ActiveDirectoryAccountState.Error.PASSWORD_EXPIRED, new CredentialExpiredException()); this.errorMap.put(EDirectoryAccountState.Error.ACCOUNT_EXPIRED, new AccountExpiredException()); this.errorMap.put(EDirectoryAccountState.Error.LOGIN_LOCKOUT, new AccountLockedException()); this.errorMap.put(EDirectoryAccountState.Error.LOGIN_TIME_LIMITED, new InvalidLoginTimeException()); this.errorMap.put(EDirectoryAccountState.Error.PASSWORD_EXPIRED, new CredentialExpiredException()); this.errorMap.put(PasswordExpirationAccountState.Error.PASSWORD_EXPIRED, new CredentialExpiredException()); this.errorMap.put(PasswordPolicyControl.Error.ACCOUNT_LOCKED, new AccountLockedException()); this.errorMap.put(PasswordPolicyControl.Error.PASSWORD_EXPIRED, new CredentialExpiredException()); this.errorMap.put(PasswordPolicyControl.Error.CHANGE_AFTER_RESET, new AccountPasswordMustChangeException()); }
throw new CredentialExpiredException("Cookies have expired.");
if (!(reply instanceof AccessAccept)) throw new CredentialExpiredException("authentication failed");
if (!(reply instanceof AccessAccept)) throw new CredentialExpiredException("authentication failed");
protected boolean performLogin() throws LoginException { CredentialCallback callback = new CredentialCallback(TokenCredential.class); handleCallbacks(new Callback[] { callback }); TokenCredential tokenCredential = (TokenCredential) callback.getCredential(); if (tokenCredential == null) { if (LOG.isDebugEnabled()) { LOG.debug("No token credential available. Skipping login for this module."); } return false; } Token token = tokenCredential.getToken(); if (!token.signatureValid(m_tokenValidationKeypair.getPublicKey())) { throw new FailedLoginException("Token signature could not be verfified"); } if (token.expired()) { throw new CredentialExpiredException("Token expired"); } m_token = token; // here we also modify the cache looUp of a possible WASLoginModule getSharedState().put(SharedState.KEY_SHARED_CACHEENTRY_MODIFIER, m_token.toBase64()); return true; }
@Override public void throwSecurityException() throws LoginException { switch (this) { case NO_SUCH_USER: throw new AccountNotFoundException(name()); case LOGON_FAILURE: throw new FailedLoginException(name()); case INVALID_LOGON_HOURS: throw new AccountLockedException(name()); case INVALID_WORKSTATION: throw new AccountException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_DISABLED: throw new AccountLockedException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case PASSWORD_MUST_CHANGE: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED_OUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown active directory error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED: throw new AccountLockedException(name()); case CHANGE_AFTER_RESET: throw new CredentialExpiredException(name()); case PASSWORD_MOD_NOT_ALLOWED: throw new AccountException(name()); case MUST_SUPPLY_OLD_PASSWORD: throw new AccountException(name()); case INSUFFICIENT_PASSWORD_QUALITY: throw new CredentialException(name()); case PASSWORD_TOO_SHORT: throw new CredentialException(name()); case PASSWORD_TOO_YOUNG: throw new CredentialException(name()); case PASSWORD_IN_HISTORY: throw new CredentialException(name()); default: throw new IllegalStateException("Unknown password policy error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case NO_SUCH_USER: throw new AccountNotFoundException(name()); case LOGON_FAILURE: throw new FailedLoginException(name()); case INVALID_LOGON_HOURS: throw new AccountLockedException(name()); case INVALID_WORKSTATION: throw new AccountException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_DISABLED: throw new AccountLockedException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case PASSWORD_MUST_CHANGE: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED_OUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown active directory error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED: throw new AccountLockedException(name()); case CHANGE_AFTER_RESET: throw new CredentialExpiredException(name()); case PASSWORD_MOD_NOT_ALLOWED: throw new AccountException(name()); case MUST_SUPPLY_OLD_PASSWORD: throw new AccountException(name()); case INSUFFICIENT_PASSWORD_QUALITY: throw new CredentialException(name()); case PASSWORD_TOO_SHORT: throw new CredentialException(name()); case PASSWORD_TOO_YOUNG: throw new CredentialException(name()); case PASSWORD_IN_HISTORY: throw new CredentialException(name()); default: throw new IllegalStateException("Unknown password policy error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case NO_SUCH_USER: throw new AccountNotFoundException(name()); case LOGON_FAILURE: throw new FailedLoginException(name()); case INVALID_LOGON_HOURS: throw new AccountLockedException(name()); case INVALID_WORKSTATION: throw new AccountException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_DISABLED: throw new AccountLockedException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case PASSWORD_MUST_CHANGE: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED_OUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown active directory error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case ACCOUNT_LOCKED: throw new AccountLockedException(name()); case CHANGE_AFTER_RESET: throw new CredentialExpiredException(name()); case PASSWORD_MOD_NOT_ALLOWED: throw new AccountException(name()); case MUST_SUPPLY_OLD_PASSWORD: throw new AccountException(name()); case INSUFFICIENT_PASSWORD_QUALITY: throw new CredentialException(name()); case PASSWORD_TOO_SHORT: throw new CredentialException(name()); case PASSWORD_TOO_YOUNG: throw new CredentialException(name()); case PASSWORD_IN_HISTORY: throw new CredentialException(name()); default: throw new IllegalStateException("Unknown password policy error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case FAILED_AUTHENTICATION: throw new FailedLoginException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case BAD_PASSWORD: throw new FailedLoginException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case MAXIMUM_LOGINS_EXCEEDED: throw new AccountLockedException(name()); case LOGIN_TIME_LIMITED: throw new AccountLockedException(name()); case LOGIN_LOCKOUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown edirectory error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case FAILED_AUTHENTICATION: throw new FailedLoginException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case BAD_PASSWORD: throw new FailedLoginException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case MAXIMUM_LOGINS_EXCEEDED: throw new AccountLockedException(name()); case LOGIN_TIME_LIMITED: throw new AccountLockedException(name()); case LOGIN_LOCKOUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown edirectory error: " + this); } }
@Override public void throwSecurityException() throws LoginException { switch (this) { case FAILED_AUTHENTICATION: throw new FailedLoginException(name()); case PASSWORD_EXPIRED: throw new CredentialExpiredException(name()); case BAD_PASSWORD: throw new FailedLoginException(name()); case ACCOUNT_EXPIRED: throw new AccountExpiredException(name()); case MAXIMUM_LOGINS_EXCEEDED: throw new AccountLockedException(name()); case LOGIN_TIME_LIMITED: throw new AccountLockedException(name()); case LOGIN_LOCKOUT: throw new AccountLockedException(name()); default: throw new IllegalStateException("Unknown edirectory error: " + this); } }
throw new CredentialExpiredException("User password has expired");
throw new CredentialExpiredException("User password has expired");