Spring Security Connection
Understand how to implement Spring Security in a Thymeleaf application by connecting user data stored in a database. Learn to create custom UserDetails and UserDetailsService implementations, handle encrypted passwords, and configure security settings to enable user authentication with email login.
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.UserDetailsServiceinterface. -
An implementation of the
org.springframework.security.core.userdetails.UserDetailsinterface.
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 if no ...