Package org.springframework.security.authentication

Examples of org.springframework.security.authentication.CredentialsExpiredException


    private class DefaultPostAuthenticationChecks implements UserDetailsChecker {
        public void check(UserDetails user) {
            if (!user.isCredentialsNonExpired()) {
                logger.debug("User account credentials have expired");

                throw new CredentialsExpiredException(messages.getMessage(
                        "AbstractUserDetailsAuthenticationProvider.credentialsExpired",
                        "User credentials have expired"), user);
            }
        }
View Full Code Here


    void raiseExceptionForErrorCode(int code, NamingException exception) {
        String hexString = Integer.toHexString(code);
        Throwable cause = new ActiveDirectoryAuthenticationException(hexString, exception.getMessage(), exception);
        switch (code) {
            case PASSWORD_EXPIRED:
                throw new CredentialsExpiredException(messages.getMessage("LdapAuthenticationProvider.credentialsExpired",
                        "User credentials have expired"), cause);
            case ACCOUNT_DISABLED:
                throw new DisabledException(messages.getMessage("LdapAuthenticationProvider.disabled",
                        "User is disabled"), cause);
            case ACCOUNT_EXPIRED:
View Full Code Here

        if (!user.isAccountNonExpired()) {
            throw new AccountExpiredException("User account has expired", user);
        }

        if (!user.isCredentialsNonExpired()) {
            throw new CredentialsExpiredException("User credentials have expired", user);
        }
    }
View Full Code Here

  private long validityWindowSeconds = 60 * 60 * 12; //we'll default to a 12-hour validity window.

  public void validateNonce(ConsumerDetails consumerDetails, long timestamp, String nonce) throws AuthenticationException {
    long nowSeconds = (System.currentTimeMillis() / 1000);
    if ((nowSeconds - timestamp) > getValidityWindowSeconds()) {
      throw new CredentialsExpiredException("Expired timestamp.");
    }
  }
View Full Code Here

  // we'll default to a 10 minute validity window, otherwise the amount of memory used on NONCES can get quite large.
  private long validityWindowSeconds = 60 * 10;

  public void validateNonce(ConsumerDetails consumerDetails, long timestamp, String nonce) {
    if (System.currentTimeMillis() / 1000 - timestamp > getValidityWindowSeconds()) {
      throw new CredentialsExpiredException("Expired timestamp.");
    }

    NonceEntry entry = new NonceEntry(consumerDetails.getConsumerKey(), timestamp, nonce);

    synchronized (NONCES) {
View Full Code Here

                sc = oauthConnector.getAccessToken((String) authToken.getCredentials(), (String) authToken.getDetails());
            }
            return createAuthentication(sc);
        } catch (IOException ie) {
            LOGGER.error("Unable to get access token", ie);
            throw new CredentialsExpiredException("OAuth login invalid or expired access token");
        }
    }
View Full Code Here

    }

    private class DefaultPostAuthenticationChecks implements UserDetailsChecker {
        public void check(UserDetails user) {
            if (!user.isCredentialsNonExpired()) {
                throw new CredentialsExpiredException(messages.getMessage(
                        "AbstractUserDetailsAuthenticationProvider.credentialsExpired",
                        "User credentials have expired"), user);
            }
        }
View Full Code Here

     */
    protected void verifyAuthenticationStatement(AuthnStatement auth, RequestedAuthnContext requestedAuthnContext, SAMLMessageContext context) throws AuthenticationException {

        // Validate that user wasn't authenticated too long time ago
        if (!isDateTimeSkewValid(getResponseSkew(), getMaxAuthenticationAge(), auth.getAuthnInstant())) {
            throw new CredentialsExpiredException("Authentication statement is too old to be used with value " + auth.getAuthnInstant());
        }

        // Validate users session is still valid
            if (auth.getSessionNotOnOrAfter() != null && auth.getSessionNotOnOrAfter().isBeforeNow()) {
            throw new CredentialsExpiredException("Authentication session is not valid on or after " + auth.getSessionNotOnOrAfter());
        }

        // Verify context
        verifyAuthnContext(requestedAuthnContext, auth.getAuthnContext(), context);

View Full Code Here

  public void check(UserDetails user) {
    if (!user.isCredentialsNonExpired()) {
      log.debug("User account credentials have expired");

      throw new CredentialsExpiredException(messages.getMessage(
          "AbstractUserDetailsAuthenticationProvider.credentialsExpired",
          "User credentials have expired"));
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.authentication.CredentialsExpiredException

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.