Package com.example.demo.security
Class PasswordEncoder
java.lang.Object
com.example.demo.security.PasswordEncoder
Configuration class that sets up necessary security beans for the application.
Specifically, it configures and provides a BCryptPasswordEncoder instance
for use throughout the application's security context.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.crypto.bcrypt.BCryptPasswordEncoderCreates and gives a BCryptPasswordEncoder to the Spring application context.
-
Constructor Details
-
PasswordEncoder
public PasswordEncoder()
-
-
Method Details
-
bCryptPasswordEncoder
@Bean public org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder bCryptPasswordEncoder()Creates and gives a BCryptPasswordEncoder to the Spring application context.This encoder is required for securely hashing user passwords before storing them and for verifying passwords during the authentication process.
- Returns:
- A new instance of BCryptPasswordEncoder.
-