Skip to content

fix: add groups claim mapper to prod j26-auth keycloak client - #52

Closed
hakan-persson wants to merge 2 commits into
mainfrom
fix/prod-keycloak-groups-mapper
Closed

fix: add groups claim mapper to prod j26-auth keycloak client#52
hakan-persson wants to merge 2 commits into
mainfrom
fix/prod-keycloak-groups-mapper

Conversation

@hakan-persson

Copy link
Copy Markdown
Member

The prod j26-auth Keycloak client was missing the Group Memberships protocol mapper that the dev environment has, so prod tokens carried no groups claim (reported as missing mappers).

Fix

Adds oidc-group-membership-mapper to the j26-auth client in the prod keycloak-config ConfigMap — full group paths, multivalued, emitted into all token types (access / ID / userinfo / introspection), claim name groups. On the next config-cli import this materialises on the client.

Already verified live in prod

The mapper has been applied and confirmed on the running j26-auth client via kcadm (claim.name=groups, full.path=true); the config-cli import ran clean (no errors). This PR makes the fix durable — without it in git, the next git-sourced ArgoCD sync re-runs the config-cli hook Job with the old config and strips the manually-applied mapper.

Scope / safety

  • Touches only the prod copy k8s/app-manifest-prod/j26-keycloak-scoutid/45-keycloak-config-configmap.yaml.
  • namespace: j26-prod preserved; dev is untouched.
  • 16-line insertion, no other changes.

🤖 Generated with Claude Code

The prod j26-auth client was missing the Group Memberships protocol mapper
that dev has, so prod tokens carried no `groups` claim. Add the
oidc-group-membership-mapper (full paths, multivalued) to the prod
keycloak-config ConfigMap so config-cli materialises it on import.

Verified live in prod: the mapper is present on the running j26-auth
client (claim.name=groups, full.path=true, all token types). This commit
makes it durable — otherwise the next git-sourced ArgoCD sync re-runs the
config-cli hook Job and strips the manually-applied mapper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 5, 2026 16:00
@hakan-persson
hakan-persson requested a review from a team as a code owner July 5, 2026 16:00
@hakan-persson
hakan-persson requested a review from scriptcoded July 5, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes the production j26-auth Keycloak client configuration declarative by adding the missing Group Memberships OIDC protocol mapper so prod-issued tokens include a groups claim (as intended), preventing future ArgoCD/config-cli syncs from removing the mapper.

Changes:

  • Adds an oidc-group-membership-mapper protocol mapper to the prod j26-auth client.
  • Configures the mapper to emit full group paths as a multivalued groups claim into access/ID/userinfo and introspection tokens.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +664 to +665
# Emits a `groups` claim (full group paths, multivalued) into the
# access/ID/userinfo tokens. Present in dev; add here so prod matches.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — fixed in 8a9c609. The comment now lists all four token types (access / ID / userinfo / introspection) and drops the unverifiable "Present in dev" reference, stating the reason the mapper exists instead. (Dev's copy lives in the separate j26-keycloak-scoutid repo, so it can't be substantiated from here.)

scriptcoded
scriptcoded previously approved these changes Jul 5, 2026
Address Copilot review on #52: the comment listed only access/ID/userinfo
but the mapper also targets introspection tokens, and the 'Present in dev'
reference can't be substantiated from this repo. State all four token types
and the reason the mapper exists instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hakan-persson added a commit that referenced this pull request Jul 5, 2026
Regenerate 45-keycloak-config-configmap.yaml from the j26-keycloak-scoutid
source repo so it carries BOTH the j26-booking roles (this PR) AND the
j26-auth groups-claim mapper (PR #52) — the source has both. Without this,
merging this PR would drop the groups mapper that is live in prod.

Diff vs the source-repo file is only the namespace (j26-prod). Supersedes
PR #52, which can now close as absorbed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
hakan-persson added a commit that referenced this pull request Jul 5, 2026
Regenerate 45-keycloak-config-configmap.yaml from the j26-keycloak-scoutid
source repo so it carries BOTH the j26-booking roles (this PR) AND the
j26-auth groups-claim mapper (PR #52) — the source has both. Without this,
merging this PR would drop the groups mapper that is live in prod.

Diff vs the source-repo file is only the namespace (j26-prod). Supersedes
PR #52, which can now close as absorbed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@scriptcoded scriptcoded closed this Jul 5, 2026
@hakan-persson

Copy link
Copy Markdown
Member Author

Auto-closed when #55 merged (14e8ad0). #55 regenerated 45-keycloak-config-configmap.yaml from the j26-keycloak source repo, which carries both this groups-claim mapper and the new booking roles — so this PR'''s change is now on main. Verified live in prod: the Group Memberships mapper is present on the j26-auth client and token issuance works. Closing as absorbed. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants