Cells 1.0 - Workflows: User creation
## 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 !139519+ 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.
## Current registration flows
### Gitlab.com
<details><summary>Trial Registration</summary>
```mermaid
flowchart TD
A["/-/trial_registrations/new"] --->B[identity verification]
B ---> C["/users/sign_up/welcome"]
C ---> D["/users/sign_up/company/new"]
D ---> DD[Trial Lead sent to CustomersDot]
DD ---> E["/users/sign_up/groups/new"]
E ---> EF[Trial Applied via CustomersDot]
EF ---> F["/*namespace_id/:project_id/-/learn_gitlab/onboarding"]
F ---> G["/*namespace_id/:project_id/-/learn_gitlab"]
```
</details>
<details><summary>Subscription Registration</summary>
```mermaid
flowchart TD
A["/-/subscriptions/new"] --->AA["/users/sign_up"]
AA ---> B[identity verification]
B ---> C["/users/sign_up/welcome"]
C ---> D["/-/subscriptions/new"]
D ---> E["/-/subscriptions" checkout process]
E ---> F["/-/subscriptions/groups/:id/edit"]
F ---> G[Group overview page]
```
</details>
<details><summary>Free Registration w/automatic trial option</summary>
```mermaid
flowchart TD
A["/users/sign_up"] --->B[identity verification]
B ---> C["/users/sign_up/welcome"]
C ---> DD{My company or team}
DD ---> | yes | DE[Automatic trial set]
DE ---> D["/users/sign_up/company/new"]
DD ---> | no | E["/users/sign_up/groups/new"]
D ---> DF[Trial Lead sent to CustomersDot]
DF ---> E["/users/sign_up/groups/new"]
E ---> EE{Trial?}
EE ---> | yes | FF[Trial applied via CustomersDot]
FF ---> F["/*namespace_id/:project_id/-/learn_gitlab/onboarding"]
EE ---> | no | F
F ---> G["/*namespace_id/:project_id/-/learn_gitlab"]
```
</details>
<details><summary>Invite Registration</summary>
```mermaid
flowchart TD
A["/users/sign_up"] --->C["/users/sign_up/welcome"]
C ---> D[Group or Project overview page from invite]
```
</details>
### Self-Managed
<details><summary>Standard Registration</summary>
```mermaid
flowchart TD
A["/users/sign_up"] --->D["/dashboard/projects"]
```
</details>
<details><summary>Invite Registration</summary>
```mermaid
flowchart TD
A["/users/sign_up"] --->C[Group or Project overview page from invite]
```
</details>
## Plan
### User creation
#### Covering
- Registration through SSO/regular with password/oauth
- Admin user creation
- SAML
- others?
- Trials
- Subscriptions
### Default organization on user creation
Right now the plan is to add every created user to the default organization(see gitlab#437891). 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.
epic