Package sample.domain

Examples of sample.domain.User


    private UserDAO userDAO = null;

    public UserDetails loadUserByUsername(String username)
            throws AuthenticationException {
        try {
            User user = userDAO.findByUsername(username);

            return new org.springframework.security.core.userdetails.User(user
                    .getUsername(), user.getPassword(), true, true, true, true,
                    AuthorityUtils.createAuthorityList("ROLE_USER"));
        } catch (Exception e) {
            LOG.error(e.getMessage(), e);
            throw new UsernameNotFoundException("No matching account", e);
        }
View Full Code Here


            throw new UsernameNotFoundException("No matching account", e);
        }
    }

    public UserDetails register(String username, String password) {
        User user = new User(username, password);
        userDAO.persist(user);
        return new org.springframework.security.core.userdetails.User(user
                .getUsername(), user.getPassword(), true, true, true, true,
                AuthorityUtils.createAuthorityList("ROLE_USER"));

    }
View Full Code Here

TOP

Related Classes of sample.domain.User

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.