Package org.acegisecurity

Examples of org.acegisecurity.BadCredentialsException


                if (passwordFile != null) {
                    try {
                        password = new FilePath(command.channel, passwordFile).readToString().trim();
                    } catch (IOException e) {
                        throw new BadCredentialsException("Failed to read " + passwordFile, e);
                    }
                }
                if (password == null) {
                    password = command.channel.call(new InteractivelyAskForPassword());
                }

                if (password == null) {
                    throw new BadCredentialsException("No password specified");
                }

                UserDetails d = AbstractPasswordBasedSecurityRealm.this.doAuthenticate(userName, password);
                return new UsernamePasswordAuthenticationToken(d, password, d.getAuthorities());
            }
View Full Code Here


        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

    @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

                    groups[i++] = new GrantedAuthorityImpl(g);
                EnvVars.setHudsonUserEnvVar(username);
                // I never understood why Acegi insists on keeping the password...
                return new UsernamePasswordAuthenticationToken(username, password, groups);
            } catch (PAMException e) {
                throw new BadCredentialsException(e.getMessage(),e);
            }
        }
View Full Code Here

TOP

Related Classes of org.acegisecurity.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.