Package org.springframework.security.authentication

Examples of org.springframework.security.authentication.LockedException


    }

    if (userAuth == null || user == null || user.getIdentifier() == null) {
      throw new BadCredentialsException("Bad credentials.");
    } else if (!user.isEnabled()) {
      throw new LockedException("Account is locked.");
    }
    return userAuth;
  }
View Full Code Here


  @Test(expected = InvalidGrantException.class)
  public void testAccountLocked() {
    ResourceOwnerPasswordTokenGranter granter = new ResourceOwnerPasswordTokenGranter(new AuthenticationManager() {
      public Authentication authenticate(Authentication authentication) throws AuthenticationException {
        throw new LockedException("test");
      }
    }, providerTokenServices, clientDetailsService, requestFactory);
    granter.grant("password", tokenRequest);
  }
View Full Code Here

            UserDetails user = userDetailsContextMapper.mapUserFromContext(userData, username, extraAuthorities);

            return createSuccessfulAuthentication(userToken, user);
        } catch (PasswordPolicyException ppe) {
            // The only reason a ppolicy exception can occur during a bind is that the account is locked.
            throw new LockedException(messages.getMessage(ppe.getStatus().getErrorCode(),
                    ppe.getStatus().getDefaultMessage()));
        } catch (UsernameNotFoundException notFound) {
            if (hideUserNotFoundExceptions) {
                throw new BadCredentialsException(messages.getMessage(
                        "LdapAuthenticationProvider.badCredentials", "Bad credentials"));
View Full Code Here

    }

    private class DefaultPreAuthenticationChecks implements UserDetailsChecker {
        public void check(UserDetails user) {
            if (!user.isAccountNonLocked()) {
                throw new LockedException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.locked",
                        "User account is locked"), user);
            }

            if (!user.isEnabled()) {
                throw new DisabledException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.disabled",
View Full Code Here

    }

    if (userAuth == null || user == null || user.getIdentifier() == null) {
      throw new BadCredentialsException("Bad credentials.");
    } else if (!user.isEnabled()) {
      throw new LockedException("Account is locked.");
//    } else {
//      SecurityUtils.setAuthCookie(user, request, response);
    }
    return userAuth;
  }
View Full Code Here

    }

    if (userAuth == null || user == null || user.getIdentifier() == null) {
      throw new BadCredentialsException("Bad credentials.");
    } else if (!user.isEnabled()) {
      throw new LockedException("Account is locked.");
//    } else {
//      SecurityUtils.setAuthCookie(user, request, response);
    }
    return userAuth;
  }
View Full Code Here

    }

    if (userAuth == null || user == null || user.getIdentifier() == null) {
      throw new BadCredentialsException("Bad credentials.");
    } else if (!user.isEnabled()) {
      throw new LockedException("Account is locked.");
//    } else {
//      SecurityUtils.setAuthCookie(user, request, response);
    }
    return userAuth;
  }
View Full Code Here

  public void check(UserDetails user) {
    if (!user.isAccountNonLocked()) {
      log.debug("User account is locked");

      throw new LockedException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.locked",
        "User account is locked"));
    }

    if (!user.isEnabled()) {
      log.debug("User account is disabled");
View Full Code Here

TOP

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

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.