GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Implement UserDetailsPasswordService in JdbcUserDetailsManager by jhl221123 · Pull Request #17071 · spring-projects/spring-security

Conversation

@jhl221123

@jhl221123 jhl221123 commented May 7, 2025

Copy link
Copy Markdown
Contributor

Summary:

Implements UserDetailsPasswordService in JdbcUserDetailsManager to allow password updates, controlled by a new flag.

Changes:

  • Added updatePassword(UserDetails user, String newPassword) method.
  • Introduced enableUpdatePassword boolean property (default: false) and setter setEnableUpdatePassword(boolean).
  • updatePassword method logic updated:
    • If enableUpdatePassword is true, it updates the user's password via updateUser.
    • If enableUpdatePassword is false, it returns the original UserDetails without performing any update.
  • Added tests in JdbcUserDetailsManagerTests to verify both scenarios (updatePasswordWhenDisabledReturnOriginalUser and updatePasswordWhenEnabledShouldUpdatePassword).

Closes gh-16863

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dev-jonghoonpark and injae-kim reacted with thumbs up emoji injae-kim reacted with heart emoji
All reactions
  • 👍 2 reactions
  • ❤️ 1 reaction
@jhl221123
Implement UserDetailsPasswordService in JdbcUserDetailsManager
16d42ac
Signed-off-by: Junhyeok Lee <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 7, 2025
@injae-kim injae-kim mentioned this pull request May 9, 2025
JdbcUserDetailsManager.setEnableUpdatePassword #16863
Closed
injae-kim
injae-kim reviewed May 9, 2025
View reviewed changes
Comment thread core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java
@@ -65,7 +66,8 @@
* @author Luke Taylor

@injae-kim injae-kim May 9, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add your name on here?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jhl221123 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java
Comment on lines +624 to +625
@Override
public UserDetails updatePassword(UserDetails user, String newPassword) {

@injae-kim injae-kim May 9, 2025

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Override
public UserDetails updatePassword(UserDetails user, String newPassword) {
@Override
/**
* comments like "updatePassword only when {@link #enableUpdatePassword} is true?
*/
public UserDetails updatePassword(UserDetails user, String newPassword) {

nit. how about adding comment about updatePassword flag?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jhl221123 reacted with thumbs up emoji jhl221123 reacted with eyes emoji
All reactions
  • 👍 1 reaction
  • 👀 1 reaction
@jhl221123
Update JdbcUserDetailsManager Javadoc and author
6adf93e
Signed-off-by: Junhyeok Lee <[email protected]>
@rwinch rwinch self-assigned this May 14, 2025
@rwinch rwinch added in: core An issue in spring-security-core type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels May 14, 2025
@rwinch
rwinch enabled auto-merge (rebase) May 14, 2025 18:27
@rwinch

rwinch commented May 14, 2025

Copy link
Copy Markdown
Member

Thank you for the PR @jhl221123! This is now queued to be merged into main as soon as the build passes

jhl221123 reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rwinch
rwinch merged commit e30dc42 into spring-projects:main May 14, 2025
@ngocnhan-tran1996 ngocnhan-tran1996 mentioned this pull request May 19, 2025
Cleanup code #17142
Merged
@jhl221123 jhl221123 mentioned this pull request Dec 28, 2025
📢오픈소스 기여모임 - 운영진 소개 opensource-contributors-group/opensource-contributors#2
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@injae-kim injae-kim injae-kim left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@rwinch rwinch

Labels

in: core An issue in spring-security-core type: enhancement A general enhancement

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

JdbcUserDetailsManager.setEnableUpdatePassword

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@jhl221123 @rwinch @injae-kim @spring-projects-issues
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.