Skip to content

Multitenancy: Replace SecurityAugmentor by ContainerRequestFilter to cache users in DB, while being compatible with multitenancy#478

Open
GeoffreyKarnbach wants to merge 2 commits intonextfrom
gk/replace-security-augmentor
Open

Multitenancy: Replace SecurityAugmentor by ContainerRequestFilter to cache users in DB, while being compatible with multitenancy#478
GeoffreyKarnbach wants to merge 2 commits intonextfrom
gk/replace-security-augmentor

Conversation

@GeoffreyKarnbach
Copy link
Contributor

@GeoffreyKarnbach GeoffreyKarnbach commented Mar 11, 2026

Description

Refactoring / Bugfix

What does this PR do?

This PR resolves a compatibility issue between the OIDC user synchronization and multitenancy.

  • Before: User syncing was handled by DamapSecurityAugmentor. Because security augmentors run extremely early in the Quarkus reactive pipeline, it attempted to execute database operations before the multitenancy context was fully established, causing tenant routing errors.
  • Now: Replaced the augmentor with UserSyncFilter (implementing ContainerRequestFilter). This ensures the user sync executes after authentication and tenant resolution are complete, allowing it to safely write to the correct tenant's database.

(Note: This solution was tested locally with the multitenancy setup active and successfully passed, routing and saving users to the correct tenant databases.)

…cache users in DB, while being compatible with multitenancy
@GeoffreyKarnbach GeoffreyKarnbach requested a review from a team as a code owner March 11, 2026 14:18
@SotosTsepe
Copy link
Member

Tested on OpenShift, unfortunately doesn't work:
message.txt

I still had to guard the null tenantId (before login) to make it work.

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