[Design Discussion] Flexible OU and User Type Resolution Order in Onboarding Flows #2121
DonOmalVindula
started this conversation in
Design
Replies: 1 comment
-
|
Rather than adding a new I'm thinking whether we need to have this error. Even with this improvement, it is still mandatory to have the [1] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Related Feature Issue
#2140
Problem Summary
In the current user onboarding (invite) flow, the admin must select a user type first, then an OU. The OU tree picker is scoped to the selected user type's schema OU, hiding OUs outside that subtree. This is limiting for multi-tenant deployments (e.g., WSO2 Cloud) where admins need to see the full OU tree and pick an OU first — then have the system narrow down which user types are valid for that OU. Today, only one ordering is possible because
OUResolverExecutorhard-depends onUserTypeResolverhaving run first.High-Level Approach
OUResolverExecutorandUserTypeResolverorder-independent so either can run first in a flow."promptAll") that shows the full OU tree without depending on a pre-selected user type.UserTypeResolverso it can narrow schemas based on a previously selected OU.Supported flow variants:
UserTypeResolver→OUResolverExecutor("prompt")OUResolverExecutor("promptAll")→UserTypeResolverArchitecture Overview
Current coupling
OUResolverExecutorin"prompt"mode readsdefaultOUIDfrom RuntimeData, which is set byUserTypeResolver. IfdefaultOUIDis missing, execution fails. This forces the UserType-first ordering.Proposed: order-independent executors
Each executor checks what RuntimeData is already available and adapts:
OU-first flow:

UserType-first flow (unchanged):

Filtering logic: which user types are valid for a given OU?
Each user schema has an
OUID— the OU it was created under. A schema is valid for any OU that is a descendant of (or equal to) the schema's OU. This uses the sameIsParent()validation thatuser/service.go:validateOrganizationUnitForUserType()already enforces at user creation time.b2b_personinternal_employeeb2b_personSecurity Considerations
"promptAll"strategy shows the full OU tree to the admin, including OUs above their own level. This is intentional for the use case (admin inviting users across the org). Deployments that want to restrict OU visibility should continue using"prompt"or"caller"strategies.user/service.go:validateOrganizationUnitForUserType()continues to enforce that the user's OU is valid for the selected schema at user creation time. The flow-level filtering is a UX convenience, not a security boundary.Impacted Areas
OUResolverExecutor,UserTypeResolver, executor registryrootOuIdis provided (needs verification)Alternatives Considered
Alternative 1: Single executor that handles both OU and user type selection
Alternative 2: Make
"prompt"strategy fall back to full tree whendefaultOUIDis absentdefaultOUIDis missing, which catches misconfiguration); implicit behavior harder to reason about"promptAll"strategy — clearer intent, no risk to existing flowsAlternative 3: Scope
"promptAll"to caller's OU subtree instead of full treeQuestions for Discussion
Frontend OU tree picker behavior: When no
rootOuIdis provided inAdditionalData, does the gate app's OU tree picker render the full tree from root by default? Or does it need an explicit root OU ID? This determines whether"promptAll"needs to look up and pass the root OU.Validation on OU selection in
"promptAll": Should we validate that at least one user type exists for the selected OU at the OU selection step? Or defer that toUserTypeResolver(which would show "no valid user types" if none match)? Early validation is better UX but adds coupling.Should
"promptAll"be the name? Other candidates:"tree","fullTree","global". The name should clearly convey "shows the entire OU hierarchy without scoping."Auto-selection behavior in OU-first flow: When
UserTypeResolverfilters schemas by OU and only one remains, it auto-selects (admin never sees a user type prompt). Should this auto-selection be configurable, or is it always the right behavior?Beta Was this translation helpful? Give feedback.
All reactions