Skip to content

feat(user_oidc): Add provider_id/sub columns and getByProviderAndSub() - #1498

Merged
CarlSchwan merged 1 commit into
mainfrom
carl/sub
Aug 24, 2026
Merged

feat(user_oidc): Add provider_id/sub columns and getByProviderAndSub()#1498
CarlSchwan merged 1 commit into
mainfrom
carl/sub

Conversation

@CarlSchwan

@CarlSchwan CarlSchwan commented Aug 24, 2026

Copy link
Copy Markdown
Member

Store the provider and OIDC subject claim a user was provisioned from alongside the (possibly hashed) user_id, and look accounts up by this (provider_id, sub) pair first in getOrCreate(). This keeps a provider's own attribute drift (e.g. the mapped uid attribute changing) from forking the account into a second, empty one.

Existing rows are backfilled opportunistically on next login, since the original sub is not recoverable from a one-way hashed user_id.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Comment thread lib/Db/UserMapper.php
Comment thread lib/Migration/Version081100Date20260824120000.php Outdated

@come-nc come-nc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good apart from above nitpick

Store the provider and OIDC subject claim a user was provisioned from
alongside the (possibly hashed) user_id, and look accounts up by this
(provider_id, sub) pair first in getOrCreate(). This keeps a
provider's own attribute drift (e.g. the mapped uid attribute
changing) from forking the account into a second, empty one.

Existing rows are backfilled opportunistically on next login, since
the original sub is not recoverable from a one-way hashed user_id.

Signed-off-by: Carl Schwan <carl@carlschwan.eu>
@CarlSchwan CarlSchwan self-assigned this Aug 24, 2026
@CarlSchwan
CarlSchwan merged commit dd1cbfa into main Aug 24, 2026
51 checks passed
@CarlSchwan
CarlSchwan deleted the carl/sub branch August 24, 2026 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants