How can you implement password hashing in Spring Security?
- Use the PasswordEncoder interface and configure it in the security configuration.
- Define a HashPassword bean in the application context.
- Include a hash attribute in the user's password field.
- Implement a custom hashing algorithm in the SecurityConfig class.
To implement password hashing in Spring Security, you should use the PasswordEncoder interface and configure it in the security configuration. This ensures that passwords are securely hashed before being stored in the database and compared during authentication. The other options do not provide a standard or recommended approach for password hashing in Spring Security.
Loading...
Related Quiz
- How can you create a custom query method in a Spring Data JPA repository?
- How do you handle situations where a service registered with Eureka becomes unavailable?
- In a Spring Boot application, which utility is primarily used for performing HTTP requests in integration tests?
- The ordering of Auto Configurations can be controlled using the @_____ annotation or property.
- To ensure the security of passwords, Spring Security recommends using a _____ password encoder.