Examples of UsernameNotFoundException


Examples of com.jeecms.common.security.UsernameNotFoundException

  public UnifiedUser login(String username, String password, String ip)
      throws UsernameNotFoundException, BadCredentialsException {
    UnifiedUser user = getByUsername(username);
    if (user == null) {
      throw new UsernameNotFoundException("username not found: "
          + username);
    }
    System.out.println("com.jeecms.core.manager.impl.UnifiedUserMngImpl.login 这里我把密码取消了");
    /*
    if (!pwdEncoder.isPasswordValid(user.getPassword(), password)) {
View Full Code Here

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

        throw new NullorEmptySecretException("Oops, KeyPair secret " +
          "for user (" + id + ") was null or unknown.");
      }
      return kp;
    } catch (Exception e) {
      throw new UsernameNotFoundException("Failed to load required " +
        "user details for ID: " + id, e);
    }
  }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

            throws UsernameNotFoundException, DataAccessException {

      SecurityService service = ServiceLocator.instance().getSecurityService();
        UserDetailsVO userDetailsVO = service.getUserDetails(username);
        if (userDetailsVO == null) {
            throw new UsernameNotFoundException("User " + username + " not found");
        }
        return new UserDetailsImpl(userDetailsVO);
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

                return new org.acegisecurity.userdetails.User(username,"",true,true,true,true,new GrantedAuthority[]{AUTHENTICATED_AUTHORITY});
            }

            @Override
            public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException {
                throw new UsernameNotFoundException(groupname);
            }
        };
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

  }

  public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
    List users = usersByUsernameMapping.execute(username);
    if (users.size() == 0)
      throw new UsernameNotFoundException("User not found");
    UserDetails user = (UserDetails) users.get(0);
    List dbAuths = this.customAuthoritiesByUsernameMapping.execute(new Object[]{user.getUsername(),user.getUsername(),user.getUsername()});
    addCustomAuthorities(user.getUsername(), dbAuths);
    //if (dbAuths.size() == 0)
    //  throw new UsernameNotFoundException("User has no GrantedAuthority");
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

    /**
     * This implementation doesn't support groups.
     */
    @Override
    public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException {
        throw new UsernameNotFoundException(groupname);
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

    @Override
    public Details loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        User u = User.get(username,false);
        Details p = u!=null ? u.getProperty(Details.class) : null;
        if(p==null)
            throw new UsernameNotFoundException("Password is not set: "+username);
        if(p.getUser()==null)
            throw new AssertionError();
        return p;
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

    }

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException, DataAccessException {
        if(!UnixUser.exists(username))
            throw new UsernameNotFoundException("No such Unix user: "+username);
        try {
            UnixUser uu = new UnixUser(username);
            // return some dummy instance
            return new User(username,"",true,true,true,true, toAuthorities(uu));
        } catch (PAMException e) {
            throw new UsernameNotFoundException("Failed to load information about Unix user "+username,e);
        }
    }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

            group = groupname.substring(1);
        } else {
            group = groupname;
        }
        if(CLibrary.libc.getgrnam(group)==null)
            throw new UsernameNotFoundException(group);
        return new GroupDetails() {
            @Override
            public String getName() {
                return group;
            }
View Full Code Here

Examples of org.acegisecurity.userdetails.UsernameNotFoundException

                return new org.acegisecurity.userdetails.User(username,"",true,true,true,true,new GrantedAuthority[]{AUTHENTICATED_AUTHORITY});
            }

            @Override
            public GroupDetails loadGroupByGroupname(String groupname) throws UsernameNotFoundException, DataAccessException {
                throw new UsernameNotFoundException(groupname);
            }
        };
    }
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.