Registry enhancement - Feature to add keycloak roles to the users #3
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.
Usecase scenario:
Creating a user in the registry will create a user in keycloak. currently, we don't have any feature in registry to add keycloak roles to users.
Adding keycloak roles to users, will help to give different privileges to users. For example, we can give access to different users to different APIs based on their roles, which can be extracted from JWT token(as it contains role information).
Sample request body with
roles
:The
roles
property should be of typeList
, as multiple roles can be assigned to a person.Whatever the roles is passed in the request body, the same will be added to user in keycloak. If
roles
property is not define in the request body, registry will consider that as empty list and no role will be added.Configuration changes:
(keycloak -> roles -> add role)
( Keycloak -> open client(which is configured as client_id in application.yml) -> Service Account Roles -> Client Roles, select 'realm-management' -> Assign 'view-realm' role)
Future enhancements:
Discussion link: Sunbird-RC/community#178