p2-inc / keycloak-orgs

Single realm, multi-tenancy for SaaS apps
Other
362 stars 65 forks source link

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

Closed xgp closed 4 months ago

xgp commented 4 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 4 months ago

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