Class AuthUserService

  • All Implemented Interfaces:
    org.springframework.security.core.userdetails.UserDetailsService

    @Service
    public class AuthUserService
    extends Object
    implements org.springframework.security.core.userdetails.UserDetailsService
    Class represent service which is responsible for authorization operations
    • Constructor Detail

      • AuthUserService

        public AuthUserService()
    • Method Detail

      • loadUserByUsername

        public org.springframework.security.core.userdetails.UserDetails loadUserByUsername​(String username)
                                                                                     throws org.springframework.security.core.userdetails.UsernameNotFoundException
        Gets user by his username
        Specified by:
        loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsService
        Parameters:
        username - username
        Returns:
        user details of found user
        Throws:
        org.springframework.security.core.userdetails.UsernameNotFoundException - exception
      • loadUserById

        public User loadUserById​(Long id)
        Get user by his id
        Parameters:
        id - user id
        Returns:
        found user