Populate realmconfig on configs response based on user permissions #983
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.
Purpose
This pull request introduces a more secure and robust way to retrieve realm configuration details in the
ServerConfigManagementServiceby adding user authorization checks. Now, only authorized users can view admin user and role information, and sensitive data exposure is minimized. The implementation also introduces helper methods for user authentication and authorization, and updates a dependency version.Security and Authorization Enhancements
RealmConfiginServerConfigManagementServiceto use a newgetRealmConfig()method, which checks if the authenticated user is authorized to view admin user name and roles before including them in the response. This prevents unauthorized access to sensitive realm configuration details. [1] [2]getAuthenticatedUser()to fetch the user from thread-local properties, andcheckUserAuthorization()to verify if the user has the required permissions based on the organization context.Dependency Updates
identity.inbound.oauth2.versioninpom.xmlfrom7.0.302to7.0.351to incorporate the latest fixes and improvements.Code Maintenance
AuthenticatedUser,IdentityUtil,IdentityOAuth2Exception, andAuthzUtil. [1] [2]AUTHENTICATED_USERfor use in thread-local property lookups.Depends on