liveBook · Manning

PasswordEncoder

PasswordEncoder is a Spring Security interface and strategy for encoding passwords and verifying supplied passwords against stored encoded representations.

How 2 Manning books explain it

Spring Security in Action, Second Edition

PasswordEncoder is a Spring Security strategy for encoding passwords and matching supplied passwords against stored representations.

How it is used
Supports authentication by transforming stored passwords and validating supplied credentials through AuthenticationProvider.
How deep it goes
Defines encode, matches, and upgradeEncoding, implements plain-text and SHA-512 examples, then compares framework-provided strategies.
Examples
Uses NoOpPasswordEncoder, custom plain-text and SHA-512 implementations, BCrypt and SCrypt choices, and prefixed delegation.
What you can do after
Build it from scratch by implementing encode and matches, configure a Spring bean, or migrate algorithms with DelegatingPasswordEncoder.

Read how Spring Security in Action, Second Edition explains PasswordEncoder →

Spring in Action, Sixth Edition

PasswordEncoder is a Spring Security interface for transforming plaintext passwords into encoded representations suitable for secure storage and verification.

How it is used
Encodes registration passwords before persistence so the user details service can authenticate against stored encoded values.
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 you can do after
Apply it via dependency injection and RegistrationForm.toUser() to store encoded passwords during user registration.

Read how Spring in Action, Sixth Edition explains PasswordEncoder →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.