p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
https://phasetwo.io
Other
417 stars 72 forks source link

`OrgAddUserAuthenticatorFactory` isn't assigning roles if the user has an open invitation #180

Closed xgp closed 8 months ago

xgp commented 9 months ago

It is possible to invite a user that also implicitly has access to an org via an owned IdP. If the user comes in through that IdP and triggers the OrgAddUserAuthenticatorFactory in the post org broker flow, we should look up and complete outstanding invitations to that org for the user.

Using the code from here https://github.com/p2-inc/keycloak-orgs/blob/main/src/main/java/io/phasetwo/service/auth/invitation/InvitationRequiredAction.java#L100-L114

Should go here https://github.com/p2-inc/keycloak-orgs/blob/main/src/main/java/io/phasetwo/service/auth/OrgAddUserAuthenticatorFactory.java#L63

xgp commented 8 months ago

Fixed in https://github.com/p2-inc/keycloak-orgs/pull/186