Examples of BadCredentialsException


Examples of org.beangle.security.auth.BadCredentialsException

      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

Examples of org.beangle.security.auth.BadCredentialsException

    // 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

Examples of org.beangle.security.auth.BadCredentialsException

      }
      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

Examples of org.beangle.security.auth.BadCredentialsException

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

Examples of org.beangle.security.monitor.BadCredentialsException

  public Authentication authenticate(Authentication auth) throws AuthenticationException {
    logger.debug("Authentication using {}", getClass());
    User user = attachToUser(auth);
    if (!passwordEncoder.isPasswordValid(user.getPassword(), (String) auth.getCredentials())) {
      throw new BadCredentialsException(Authentication.ERROR_PASSWORD);
    }
    return auth;
  }
View Full Code Here

Examples of org.corrib.treemaps.source.BadCredentialsException

   * @throws BadCredentialsException
   */
  public void storeCredentials(String sscfPerson,BookmarkingSource bookmarkingSource,String login, String password) throws BadCredentialsException{
    if(login == null || "".equals(login) ||
        password == null || "".equals(password))
      throw new BadCredentialsException("Invalid login/password");
    Person person = PersonFactory.getPerson(sscfPerson);
    if(person != null){
      String mbox_sha1sum = person.getMbox_sha1sum();
      PBEKeySpec keySpec = new PBEKeySpec(mbox_sha1sum.toCharArray());
      String[] encryptedCredentials = encryptCredentials(login, password, keySpec);
View Full Code Here

Examples of org.springframework.security.BadCredentialsException

        panel.setBorder(GuiStandardUtils.createEvenlySpacedBorder(UIConstants.ONE_SPACE));
        return panel;
    }

    private void loginWithBadCredentials() {
        throw new BadCredentialsException("Wrong username/password");
    }
View Full Code Here

Examples of org.springframework.security.authentication.BadCredentialsException

            auditManager.audit(Category.authentication, AuthenticationSubCategory.login, Result.failure,
                    "User " + authentication.getPrincipal() + " not authenticated");

            LOG.debug("User {} not authenticated", authentication.getPrincipal());

            throw new BadCredentialsException("User " + authentication.getPrincipal() + " not authenticated");
        }

        return token;
    }
View Full Code Here

Examples of org.springframework.security.authentication.BadCredentialsException

    String username = obtainUsername(request).trim();
    String password = obtainPassword(request).trim();
    // System.out.println(">>>>>>>>>>000<<<<<<<<<< username is " +
    // username);
    if (Common.isEmpty(username) || Common.isEmpty(password)) {
      BadCredentialsException exception = new BadCredentialsException(
          "用户名或密码不能为空!");// 在界面输出自定义的信息!!
      throw exception;
    }

    // 验证用户账号与密码是否正确
    User users = this.userDao.querySingleUser(username);
    if (users == null || !users.getUserPassword().equals(password)) {
      BadCredentialsException exception = new BadCredentialsException(
          "用户名或密码不匹配!");// 在界面输出自定义的信息!!
      // request.setAttribute(WebAttributes.AUTHENTICATION_EXCEPTION,
      // exception);
      throw exception;
    }
View Full Code Here

Examples of org.springframework.security.authentication.BadCredentialsException

    @Test
    public void onAuthenticationFailure() throws IOException, ServletException {
        MockHttpServletRequest request = new MockHttpServletRequest();
        MockHttpServletResponse response = new MockHttpServletResponse();
        AuthenticationException ex = new BadCredentialsException("");

        failureHandler.onAuthenticationFailure(request, response, ex);

        assertEquals(MockHttpServletResponse.SC_UNAUTHORIZED, response.getStatus());
        assertEquals(RestAuthenticationFailureHandler.STATUS_MESSAGE_AUTHENTICATION_FAILED, response.getErrorMessage());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.