Spring Security Connection
Let's connect our User entity with Spring Security.
We'll cover the following...
Establishing connection
We need two things to make the connection possible:
-
An implementation of the
org.springframework.security.core.userdetails.UserDetailsService
interface. -
An implementation of the
org.springframework.security.core.userdetails.UserDetails
interface.
The UserDetailsService1
interface has a single method that takes a string. This parameter is the username
or the email
, depending on what users use to log on. The method returns an instance of UserDetails
or throws an org.springframework.security.core.userdetails.UsernameNotFoundException
...