matrix: Keycloak SSO login fails with "User exists" after the MAS upstream switch #283
Labels
No labels
bug
enhancement
in-progress
needs-info
needs-triage
p0
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Cloonar/nixos#283
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Since
c304f5cswitched the MAS upstream provider from Authelia to Keycloak, logging in to Element fails:The provider id in
hosts/fw/vms/web/matrix.nixstayed01KJPRKN397E5N8D0CA2Z3TJ7Ywhile the IdP behind it changed. MAS keys an upstream identity by(provider id, subject), so every existingupstream_oauth_linksrow still carries the Authelia subject. Keycloak returns its ownsub, MAS finds no link, provisions a fresh account, derives the same localpart from the email claim — and that localpart is already taken.The refusal itself is
claims_imports.localpart.on_conflictdefaulting tofail. Existing accounts need their link repointed at the new subject on first Keycloak login.Related to #266.
Fix is on branch
fix/mas-keycloak-localpart-conflict(63d5366) — setsclaims_imports.localpart.on_conflict: replaceon the MAS upstream provider.PR not opened from this run:
POST /agent/v1/prsreturns 404 (this run has no claimed issue, so the create route is not registered). Compare link: https://git.cloonar.com/Cloonar/nixos/compare/main...fix/mas-keycloak-localpart-conflict