What I want to do is to implement the following sign-up flow, which is very common in B2B SaaS:
(1) A user signs up with a mail address or Google, etc,
(2) Create an Organization corresponding to the organization to which the user belongs,
(3) The user registers as a member of the Organization.
(4) The user invites other employees as members of the Organization.
If Organizations in Application is set to Business Users, (1) cannot be done, and if it is set to Individuals, (4) cannot be done.
If I set it to Both, (1) and (4) are solved, but when logging in, a dialog box appears asking whether you want to log in as an individual or an organization.
This is confusing and I don’t want to see it like that.
I believe the same is true for Auth0. When signing up, you enter your email address, register a password, and then enter your company name and other information.
After that, you can invite team members from the Settings page.
I would like to do exactly the same thing.
I think everyone wants to ask this to implement B2B SaaS, but I can’t find the answer anywhere. I have looked everywhere in the community here, but I can’t.
We are working on a sample SaaS application that will outline this flow.
In the meantime, we recommend using a separate application for end-user registration and login. This approach helps avoid the confusing dialog box that appears when “Both” is selected under Organizations’ Types of Users.
For example:
Signup app: Set Organizations to “Individuals.”
Login app: Set Organizations to “Business Users.”
After users sign up, have them verify their email address before allowing them to register an organization. This will help prevent bots from populating the tenant with fake users/organizations.
To register an organization, use the Management API’s Create an Organization endpoint. Then, assign the user to the organization with an Admin-type role.
Next, silently authenticate the user into the Login application and allow Admin users to invite others with different roles using the Management API.
Alternatively, you could redirect the user to the Login application after they sign up.