Package domain

Examples of domain.User


            @Override
            public Authentication authenticate(Authentication authentication)
                    throws AuthenticationException {
                Object principal = authentication.getPrincipal();
                String username = String.valueOf(principal);
                User user = myUserRepository.findByUsername(username);
                if(user == null) {
                    throw new UsernameNotFoundException("No user for principal "+principal);
                }
                if(!authentication.getCredentials().equals(user.getPassword())) {
                    throw new BadCredentialsException("Invalid password");
                }
                return new TestingAuthenticationToken(principal, null, "ROLE_USER");
            }
        };
View Full Code Here

TOP

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