Skip to content

keycloak_clientscope: Map client scope to role #7117

@aristotelos

Description

@aristotelos

Summary

In Keycloak, it is possible to map a client scope to one or more client roles or realm roles. However, it seems that the community.general.keycloak_clientscope module does not have this option.

See Keycloak documentation:

When a client scope does not have any role scope mappings defined, each user is permitted to use this client scope. However, when a client scope has role scope mappings defined, the user must be a member of at least one of the roles.

So it would be handy to have a roles option in the community.general.keycloak_clientscope task that allows a list of client or realm roles that are then mapped to that client scope.

Issue Type

Feature Idea

Component Name

keycloak_clientscope

Additional Information

Note that the following KeyCloak REST APIs (see documentation) support the scope mapping feature:

  • POST /admin/realms/{realm}/client-scopes/{id}/scope-mappings/realm
  • POST /admin/realms/{realm}/client-scopes/{id}/scope-mappings/clients/{client}

Code of Conduct

  • I agree to follow the Ansible Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureThis issue/PR relates to a feature requestmodulemodulepluginsplugin (any type)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions