PasswordEncoder is a Spring Security interface for transforming plaintext passwords into encoded representations suitable for secure storage and verification.
PasswordEncoder is a Spring Security interface that transforms a submitted plaintext password into an encoded value before the user record is saved. Authentication can then check the submitted password against the stored representation. section 5.2.2
Encoding a registration password
Inject the shared PasswordEncoder into RegistrationController, then pass it to RegistrationForm.toUser(). That method calls passwordEncoder.encode(password) while creating the User, so the database receives the encoded password rather than the submitted plaintext value. section 5.2.2
How Spring in Action, Sixth Edition covers it
How deep it goes
Explains injection and the encode call in registration, but does not detail encoding algorithms or verification internals.
Examples
Uses RegistrationController and RegistrationForm.toUser() to encode a submitted password before saving a User.
What it assumes
Assumes a Spring Security authentication flow, a User entity, and persistence through a user repository.
What you can do after
Apply it via dependency injection and RegistrationForm.toUser() to store encoded passwords during user registration.
How it connects
Connects PasswordEncoder with Spring MVC registration, User entities, repositories, and the user details service.
Spring Security in Action, Second EditionPasswordEncoder is a Spring Security strategy for encoding passwords and matching supplied passwords against stored representations.
AuthenticationProviderused by · AuthenticationProvider is a Spring Security interface or component that encapsulates a specific authentication mechanism and returns an authentication result.
DelegatingPasswordEncoderincludes · DelegatingPasswordEncoder is a Spring Security PasswordEncoder implementation that selects another password encoder according to an identifier in the stored password representation.
NoOpPasswordEncoderincludes · NoOpPasswordEncoder is a Spring Security PasswordEncoder implementation that leaves passwords unencoded in cleartext.
authenticationuses · Authentication is the process of establishing or verifying the identity of a user, service, device, or other communicating entity.
BCryptPasswordEncoderincludes · BCryptPasswordEncoder is a Spring Security PasswordEncoder implementation that hashes passwords using the bcrypt password-hashing function.
This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.