Role Mappers
Map PDC default roles to AW Custom Roles ..
Role Mappers
Why do we need to configure Role Mappers .. What issue does this solve?
This part is crucial .. It completes the picture:
WHO (Identity + Organizational Structure) + WHAT (PDC Data Governance + Communities)
Keycloak knows about Adventure Works roles (aw-sales-analyst, aw-data-steward, etc.)
PDC needs to know about these Roles - mapped to default PDC Roles - to make authorization decisions
JWT tokens are the bridge between them - but by default, custom roles aren't included ..
The User Realm Role Mapper automatically includes a user's realm roles in JWT tokens sent to PDC.

Keycloak Role Mappers
Keycloak doesn't provide PDC default roles out of the box. The roles like Admin
, Data_Steward
, and Business_User
in your realm are custom roles that were specifically created for your PDC application. Keycloak only provides basic built-in roles like offline_access
and client management roles.
Role mapping is needed because it bridges authentication and authorization. When a user logs in, Keycloak authenticates them and issues a JWT token containing their assigned roles. PDC then reads these roles from the token and needs to understand what permissions to grant. For example, if someone has the aw-sales-analyst
role, PDC needs to know that means "grant access to sales dashboards and customer data."
You need both functional and domain-specific roles working together. PDC functional roles like Business_User
determine what features of the application you can use (dashboards, admin panels, etc.). Your custom AdventureWorks roles like aw-sales-analyst
determine what data domains you can access (sales data, HR data, etc.). The combination gives users complete, appropriate permissions.
The mapping happens in PDC's configuration, not Keycloak. Keycloak's job is just to put the right roles in the JWT token. PDC reads those roles and maps them to specific application permissions. That's why you assign both types of roles to your groups - so users get the complete permission set they need when they authenticate.
Sarah Johnson's Journey:
Sarah logs into PDC
Keycloak checks: "Sarah is in Sales_Analysts group, which has aw-sales-analyst role"
Mapper activates: "I need to include aw-sales-analyst in the token"
JWT created with:
{
"sub": "sarah-uuid",
"preferred_username": "sarah.johnson",
"realm_roles": ["aw-sales-analyst"],
"groups": ["/AdventureWorks_Organization/Sales_Division/Sales_Analysts"]
}
PDC receives token and thinks: "Ah! Sarah has aw-sales-analyst role, so I'll give her Data User permissions and add her to Sales Analytics community"
Keycloak Clients
Clients in Keycloak represent applications or services that need to authenticate users. Each client has a unique Client ID and represents a trust relationship between Keycloak and an application. When a user tries to access an application (like PDC), the application redirects them to Keycloak for authentication, then Keycloak redirects back to the application with an authentication token.
Clients configure how this flow works - what URLs are allowed for redirects, what type of authentication flow to use (like standard web flow or direct grants), and what scopes/claims should be included in the tokens. In your realm, you have clients like pdc-client
(your main PDC application), admin-cli
(for API access), and account
(for user self-service), each configured for their specific authentication needs.
Log into Keycloak:
Username: admin
Password: admin
Ensure you select the Pentaho Data Catalog Realm.
In the Left Menu, Select: Clients
Search and click: pdc-client

Add Client Scope Mappers
Click Client Scopes tab

Click: pdc-client-dedicated

Click Mappers tab

Click Add Mapper → By Configuration.
Click: User Realm Role.

Select the following options:
Name
AdventureWorks-Realm-Roles
Realm Role prefix
Leave blank
Multivalued
✅ ON
Token Claim Name
realm_roles
Claim JSON Type
String
Add to ID Token
✅ ON
Add to Access Token
✅ ON
Add to Userinfo
✅ ON
Click Save.

Repeat the workflow to add: 'Group Membership' mapper:
Select the following options:
Name
AdventureWorks-Groups
Realm Role prefix
Leave blank
Multivalued
✅ ON
Token Claim Name
groups
Full group path
✅ ON
Add to ID Token
✅ ON
Add to Access Token
✅ ON
Add to Userinfo
✅ ON

Click Save.
Last updated
Was this helpful?