How can you customize the UserDetailsService in Spring Security to load user information from a different source?
- Extend the UserDetailsService interface and override its methods to fetch user details from the desired source.
- Configure a CustomUserDetailsService bean in the Spring Security configuration file.
- Modify the SecurityConfig class to specify the custom user details source.
- Import a new user details module into the Spring Security framework.
To customize the UserDetailsService in Spring Security to load user information from a different source, you should extend the UserDetailsService interface and override its methods to fetch user details from your desired source, such as a database or an external service. The other options do not accurately describe the standard way to customize the UserDetailsService.
Loading...
Related Quiz
- In reactive programming with Spring Boot, which interface represents a stream of 0 or 1 item?
- You are working on a Spring Boot application where you need to implement dynamic DataSource routing based on specific conditions. How would you design and implement this functionality?
- You are developing a Spring Boot application where a bean is required to perform a task immediately after the ApplicationContext has been started. How would you implement this?
- The _____ endpoint in OAuth2 is used by the client to obtain an access token.
- How can you implement a fallback mechanism for exceptions not caught by any @ExceptionHandler methods?