Assign a user on creation to correct organization on registration

Summary

We need to figure out how to add a user to the correct organization on creation(sign up/registration/admin creation action/SAML(?)) for Cell 1.0

From Cells: Describe Cell 1.0: Support new enterpris... (!139519 - merged) we have a proposal to use:

How would users log in?

  • UI: The login to Organizations would be scoped to the Organization: https://<GITLAB_DOMAIN>/users/sign_in?organization=gitlab-inc.
  • SAML: https://<GITLAB_DOMAIN>/users/auth/saml/callback would receive ?organization=gitlab-inc which would be routed to the correct Cell.
  • This would require using the dynamic routing method with a list of Organizations available using a solution with high availability.

We can use the parameter driven concept as seen above with organization=gitlab-inc or parhaps opt for a solution that adds the org in the route(login example below, but also would apply for sign up for similar path):

https://<GITLAB_DOMAIN>/-/gitlab-inc/users/sign_in

Solving for user creation resolves adding correct organization_users entry as well as we can determine on user creation correctly which organization to add the user to.

Plan

User creation

Covering

  • Registration through SSO/regular with password/oauth
  • Admin user creation
  • SAML
  • others?

Not Covering/in focus for now as we'll assume for Cell 1.0 the organization is already created/on a plan/etc

  • Trial registration, default to default organization like it does today
  • Subscription registration

Default organization on user creation

Right now the plan is to add every created user to the default organization(see #437891 (closed)). However, if the user signs up/registers/is created by an admin in the context of an organization, we should add them to the specified organization instead of the default.

Edited by Doug Stull