Class CustomUserDetailsService
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.module.web.services.CustomUserDetailsService
-
- All Implemented Interfaces:
org.springframework.security.core.userdetails.UserDetailsService
@Service("userDetailsService") public class CustomUserDetailsService extends java.lang.Object implements org.springframework.security.core.userdetails.UserDetailsService
The custom user details service which fetches the account and their roles from the database from the authentication session information
-
-
Constructor Summary
Constructors Constructor Description CustomUserDetailsService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.springframework.security.core.userdetails.UserDetails
loadUserByUsername(java.lang.String email)
Searches for the account using the email, loads the roles associated to that account.
-
-
-
Method Detail
-
loadUserByUsername
public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(java.lang.String email) throws org.springframework.security.core.userdetails.UsernameNotFoundException
Searches for the account using the email, loads the roles associated to that account. It then creates a "user" object using the email, encoded password and roles for the authentication manager- Specified by:
loadUserByUsername
in interfaceorg.springframework.security.core.userdetails.UserDetailsService
- Parameters:
email
- the email of the user to find- Returns:
- the new "user" object
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
- if the email was not found in the database
-
-