Package org.beangle.security.auth

Examples of org.beangle.security.auth.BadCredentialsException


  public void testNullServiceTicketHandledGracefully() throws Exception {
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/demo/any-path");
    request.addParameter("ticket", "ST-0-ER94xMJmn6pha35CQRoZ");
    filter.setAuthenticationManager(new AuthenticationManager() {
      public Authentication authenticate(Authentication a) {
        throw new BadCredentialsException("Rejected");
      }
    });
    filter.setContinueOnFail(false);
    filter.doFilter(request, new MockHttpServletResponse(), mock(FilterChain.class));
  }
View Full Code Here


      this.returnTicket = returnTicket;
    }

    public Assertion validate(final String ticket, final String service) throws TicketValidationException {
      if (returnTicket) { return new AssertionImpl("rod"); }
      throw new BadCredentialsException("As requested from mock");
    }
View Full Code Here

    // If an existing CasAuthenticationToken, just check we created it
    if (casauth.isAuthenticated()) {
      if (key.hashCode() == casauth.getKeyHash()) {
        return authentication;
      } else {
        throw new BadCredentialsException("CasAuthenticationProvider.incorrectKey");
      }
    }
    // Ensure credentials are presented
    if (StringUtils.isEmpty(String.valueOf(casauth.getCredentials()))) { throw new BadCredentialsException(
        "CasAuthenticationProvider.noServiceTicket"); }
    boolean stateless = false;
    if (STATELESS_ID.equals(casauth.getPrincipal())) {
      stateless = true;
    }
View Full Code Here

      }
      userDetailChecker.check(userDetail);
      return new CasAuthentication(key, userDetail, auth.getCredentials(), userDetail.getAuthorities(),
          userDetail, assertion);
    } catch (final TicketValidationException e) {
      throw new BadCredentialsException("Bad credentials :" + auth.getCredentials().toString(), e);
    }
  }
View Full Code Here

  public Authentication doAuthentication(Authentication authentication) throws AuthenticationException {
    if (grantAccess) {
      return authentication;
    } else {
      throw new BadCredentialsException("MockAuthenticationManager instructed to deny access");
    }
  }
View Full Code Here

  public Authentication doAuthentication(Authentication authentication) throws AuthenticationException {
    if (grantAccess) {
      return authentication;
    } else {
      throw new BadCredentialsException("MockAuthenticationManager instructed to deny access");
    }
  }
View Full Code Here

  private UserDetailService<Authentication> userDetailService;

  @Override
  protected void additionalAuthenticationChecks(UserDetail user, Authentication authentication)
      throws AuthenticationException {
    if (!ldapValidator.verifyPassword(user.getUsername(), (String) authentication.getCredentials())) { throw new BadCredentialsException(); }
  }
View Full Code Here

  private UserDetailService<Authentication> userDetailService;

  @Override
  protected void additionalAuthenticationChecks(UserDetail user, Authentication auth)
      throws AuthenticationException {
    if (!passwordEncoder.isPasswordValid(user.getPassword(), (String) auth.getCredentials())) { throw new BadCredentialsException(); }
  }
View Full Code Here

  private UserDetailService<Authentication> userDetailService;

  @Override
  protected void additionalAuthenticationChecks(UserDetail user,
      UsernamePasswordAuthentication auth) throws AuthenticationException {
    if (!passwordEncoder.isPasswordValid(user.getPassword(), (String) auth.getCredentials())) { throw new BadCredentialsException(); }
  }
View Full Code Here

    // If an existing CasAuthenticationToken, just check we created it
    if (casauth.isAuthenticated()) {
      if (key.hashCode() == casauth.getKeyHash()) {
        return authentication;
      } else {
        throw new BadCredentialsException("CasAuthenticationProvider.incorrectKey");
      }
    }
    // Ensure credentials are presented
    if (StringUtils.isEmpty(String.valueOf(casauth.getCredentials()))) { throw new BadCredentialsException(
        "CasAuthenticationProvider.noServiceTicket"); }
    boolean stateless = false;
    if (STATELESS_ID.equals(casauth.getPrincipal())) {
      stateless = true;
    }
View Full Code Here

TOP

Related Classes of org.beangle.security.auth.BadCredentialsException

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.