I am creating an oauth service in spring-boot and want to use user information from a MariaDB for authentication. When implementing UserDetailsService I have to override the function loadUserByUsername. The problem is that my user model does not have a field username, instead of this I want to load the users using their mail address. So my question: How do I correctly implement the UserDetailsService without having an username?
Then the mail address is the user name.
It is just a text value that uniquely identify the user with the domain. It can be a:
as long as it is unique, so that loadUserByUsername
can find exactly one record.