FGAP v2: Introduce RESET_PASSWORD scope and evaluation; scope-first with fallback to MANAGE when no policies#42307
Merged
pedroigor merged 1 commit intokeycloak:mainfrom Sep 3, 2025
Bagautdino:main
Merged
FGAP v2: Introduce RESET_PASSWORD scope and evaluation; scope-first with fallback to MANAGE when no policies#42307pedroigor merged 1 commit intokeycloak:mainfrom Bagautdino:main
pedroigor merged 1 commit intokeycloak:mainfrom
Bagautdino:main
Conversation
- Add RESET_PASSWORD to AdminPermissionsSchema.USERS - Require RESET_PASSWORD in UserResource.resetPassword() - Expose canResetPassword()/requireResetPassword() - Implement FGAP v2 deny-overrides + secure-by-default + optional fallback - Include access.resetPassword for Admin Console Closes #41901 Co-authored-by: Pedro Igor <pigor.craveiro@gmail.com> Signed-off-by: Bagautdino <336373@edu.itmo.ru>
This was referenced Sep 3, 2025
pedroigor
approved these changes
Sep 3, 2025
Contributor
|
Thanks, @Bagautdino ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #41901
Supersedes #42298
Restores and replaces the context from #41904
Summary
Introduce a dedicated
RESET_PASSWORDscope for the FGAP v2 USERS resource and evaluate password-reset access via explicit policies first.If no
reset-passwordpolicies exist for the target, evaluation falls back toMANAGE(backward-compatible path).Self-service password change (caller == target user) remains allowed without FGAP checks.
Motivation
Currently, password resets can be implicitly allowed via
MANAGE_USERS, which weakens governance/auditing.With FGAP v2, password resets should be controlled by explicit policies with deny-overrides semantics.
Behavior (FGAP v2)
reset-password:reset-passwordpolicies:MANAGEevaluation to keep compatibility.Implementation
RESET_PASSWORDtoAdminPermissionsSchema.USERS.RESET_PASSWORDinUserResource.resetPassword()rather thanMANAGE_USERS.canResetPassword()/requireResetPassword()in the user permissions API.UserPermissionsV2, with fallback toMANAGEonly when noreset-passwordpolicies exist.getAccess(user).resetPasswordfor Admin Console (hide the Reset Password button whenfalse).Tests
MANAGE(ALLOW/DENY).getAccess(user).resetPassword.Documentation
RESET_PASSWORDscope and evaluation flow.reset-passwordpolicies.UI
getAccess(user).resetPassword == false.Backward compatibility & Security
Performance
Follow-ups
RESET_PASSWORDpermissions (separate PR).