Examples of PracticalUserDetails


Examples of com.jverstry.DAO.PracticalUserDetails

   
    @Override
    public PracticalUserDetails loadUserByUsername(String username)
            throws UsernameNotFoundException {
       
        PracticalUserDetails retr = this.pud.read(username);
       
        if ( retr == null )
            throw new UsernameNotFoundException(username);
       
        return retr;
View Full Code Here

Examples of com.jverstry.Data.PracticalUserDetails.PracticalUserDetails

            = (UsernamePasswordAuthenticationToken) authentication;
       
        String principal = (String) retr.getPrincipal();
        String password = (String) retr.getCredentials();
       
        PracticalUserDetails user = null;
       
        try {
       
            user = pudsim.loadUserByUsername(principal);
           
        } catch(UsernameNotFoundException ex) {
           
             throw new BadCredentialsException(
                 principal + " principal not found", ex);
           
        }
       
        // Returned user is never null
        if ( !user.isEnabled() ) {
            throw new DisabledException("Username: " + user.getUsername());
        }
       
        if ( !user.isAccountNonLocked() ) {
            throw new LockedException("Username: " + user.getUsername());
        }
       
        if ( !user.getPassword().equals(password) ) {
            throw new BadCredentialsException("Username: " + user.getUsername());
        }
       
        return new UsernamePasswordAuthenticationToken(
            user.getUsername(), user.getPassword(), user.getAuthorities());
       
    }
View Full Code Here

Examples of com.jverstry.Data.PracticalUserDetails.PracticalUserDetails

   
    @Override
    public PracticalUserDetails loadUserByUsername(String username)
            throws UsernameNotFoundException {
       
        PracticalUserDetails retr = this.pud.read(username);
       
        if ( retr == null )
            throw new UsernameNotFoundException(username);
       
        return retr;
View Full Code Here

Examples of com.jverstry.Data.PracticalUserDetails.PracticalUserDetails

  public ModelAndView index() {
       
        ModelAndView result = new ModelAndView("index");

        // Anyone logged in?
        PracticalUserDetails user = PracticalAuthenticationProvider.getLoggedInUser();
       
        if ( user == null ) {
            result.addObject("loggedIn", "No one is logged in");
        } else {
            result.addObject("loggedIn", user.getUsername() + " is logged in");
        }
       
        result.addObject("users", this.pudsim.getUsers());
       
        return result;
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.