Failed Decryption with attributes #3115
-
|
Hello, here is my subject mapping
Here i my JWT And here is how i login as jen Regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
|
Hi Max, it looks like you've found a gap in our test coverage and documentation, and I've opened a PR to address it: #3122 Root cause: When using the default Keycloak ERS, subject mapping conditions are evaluated against the Keycloak user object, not the raw JWT claims. The ERS extracts There is no Fix: Update your {
"subject_external_selector_value": ".attributes.department[]",
"operator": 1,
"subject_external_values": ["Finance"]
}Alternative: If you'd prefer to match JWT claims directly, configure the ERS with One thing to be aware of in claims mode: the correct selector also depends on the multi-valued setting of your Keycloak User Attribute mapper:
The trade-off with claims mode is that the ERS only has access to what's in the token — it cannot look up Keycloak groups, roles, or other data from the user store. Please confirm if this fix works for you. 🙏 And I'll make sure to update our documentation to reflect this as well. Thanks again! |
Beta Was this translation helpful? Give feedback.
Hi Max, it looks like you've found a gap in our test coverage and documentation, and I've opened a PR to address it: #3122
Root cause: When using the default Keycloak ERS, subject mapping conditions are evaluated against the Keycloak user object, not the raw JWT claims. The ERS extracts
preferred_usernamefrom your token, calls the Keycloak Admin API to fetch the full user record, and flattens that object for evaluation. A custom Keycloak user attributedepartment: ["Finance"]appears in the flattened object as:There is no
.departmentkey. This means the selector.departmentnever matches, even though your JWT c…