Examples of BadCredentialsException


Examples of com.kolich.havalo.exceptions.authentication.BadCredentialsException

            // Compute the resulting signed signature.
            final String computed = HMACSHA256Signer.sign(userKp, stringToSign);
            // Does the signature match what was passed to us in the
            // Authorization request header?
            if(!computed.equals(signature)) {
                throw new BadCredentialsException("Signatures did not " +
                    "match (request=" + signature + ", computed=" + computed +
                    ")");
            }
            // Success!
            request.setAttribute(HAVALO_AUTHENTICATION_ATTRIBUTE, userKp);
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

        return new AbstractPasswordBasedSecurityRealm() {
            @Override
            protected UserDetails authenticate(String username, String password) throws AuthenticationException {
                if (username.equals(password))
                    return loadUserByUsername(username);
                throw new BadCredentialsException(username);
            }

            @Override
            public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
                return new org.acegisecurity.userdetails.User(username,"",true,true,true,true,new GrantedAuthority[]{AUTHENTICATED_AUTHORITY});
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

      Object salt = null;
      if (this.getSaltSource() != null) {
        salt = this.getSaltSource().getSalt(userDetails);
      }
      if (!getPasswordEncoder().isPasswordValid(userDetails.getPassword(), authentication.getCredentials().toString(), salt)) {
        throw new BadCredentialsException(messages.getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"), userDetails);
      }
    }
  }
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

      cacheWasUsed = false;
      try {
        user = retrieveUserCustom(username, (UsernamePasswordAuthenticationToken) authentication);
      } catch (UsernameNotFoundException notFound) {
        if (hideUserNotFoundExceptions) {
          throw new BadCredentialsException( messages .getMessage("AbstractUserDetailsAuthenticationProvider.badCredentials", "Bad credentials"));
        } else {
          throw notFound;
        }
      }
      Assert.notNull(user, "retrieveUser returned null - a violation of the interface contract");
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

    @Override
    protected Details authenticate(String username, String password) throws AuthenticationException {
        Details u = loadUserByUsername(username);
        if (!PASSWORD_ENCODER.isPasswordValid(u.getPassword(),password,null))
            throw new BadCredentialsException("Failed to login as "+username);
        return u;
    }
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

            UnixUser uu = new PAM(serviceName).authenticate(username, password);

            // I never understood why Acegi insists on keeping the password...
            return new User(username,"",true,true,true,true, toAuthorities(uu));
        } catch (PAMException e) {
            throw new BadCredentialsException(e.getMessage(),e);
        }
    }
View Full Code Here

Examples of org.acegisecurity.BadCredentialsException

        return new AbstractPasswordBasedSecurityRealm() {
            @Override
            protected UserDetails authenticate(String username, String password) throws AuthenticationException {
                if (username.equals(password))
                    return loadUserByUsername(username);
                throw new BadCredentialsException(username);
            }

            @Override
            public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException,
                    DataAccessException {
View Full Code Here

Examples of org.apache.james.mailbox.BadCredentialsException

     */
    public MailboxSession login(String userid, String passwd, Logger log) throws BadCredentialsException, MailboxException {
        if (login(userid, passwd)) {
            return createSession(userid, passwd, log, SessionType.User);
        } else {
            throw new BadCredentialsException();
        }
    }
View Full Code Here

Examples of org.apache.james.mailbox.exception.BadCredentialsException

    @Override
    public MailboxSession login(String userid, String passwd, Logger log) throws BadCredentialsException, MailboxException {
        if (login(userid, passwd)) {
            return createSession(userid, passwd, log, SessionType.User);
        } else {
            throw new BadCredentialsException();
        }
    }
View Full Code Here

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