spring-projects / spring-projects/spring-security
SEC-2428: support "last password change date" in the DB schema
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
ohad redlich (Migrated from SEC-2428) said:
I would like to support the feature that after the user logs-in, I can tell if it is time for him to change his password. For this, I need to add in the DB, better in the 'users' schema, another column of DATE, that indicates the last time this user has set his password.
Currently, if I work with Spring-security, and I use the current 'users' schema, I cannot support this feature.
BTW, this way developers will be able to use UserDetails.isAccountExpired(), which is currently useless. Or maybe we can add another method for this use-case...
changes required:
- new column in the DB, 'LAST_PASSWORD_CHANGE_DATE'.
- JdbcUserDetailsManager:
2.a the queries (for create account, for example) will have to change.
2.b. changePassword(): it will have to set a new value in the 'LAST_PASSWORD_CHANGE_DATE'. - interface 'UserDetails' and implelemtor 'User' will have to change accordingly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting the current users schema and the JdbcUserDetailsManager, then trace the UserDetails interface and User implementation. Update the account-creation queries and changePassword() behavior around LAST_PASSWORD_CHANGE_DATE, and define the corresponding user API so the password-change date can be used after login.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- backend, databases, security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100