Hi,
I have a React SPA that’s using two Auth0 Applications:
Login (App) Client
The default client used in the React app (SPA), where users are authenticated in the context of an Organization. It uses the Business Users login experience and Prompt for credentials. It uses the auth0-react-sdk
.
Signup (Onboarding) Client
Used for first-time signup, where users aren’t in an Organization yet, and are authenticated outside of the context of an Auth0 Organization. It’s a also configured as a Single Page Application, but uses Individual login experience. It uses auth0-spa-js
SDK to create the onboarding client.
My current flow is this:
- User enters email and clicks “Get Started”
onboardingClient.loginWithRedirect
is called and redirects to Universal Login- After signing up, user is redirected to
/onboarding
, enters their organization name and then calls a server-endpoint, and using an M2M application it:- Creates a new Auth0 Organization
- Adds user as a member of the new organization
- Returns
org_id
appClient.loginWithRedirect
is called and passesorg_id
as the organization parameter in authorizationParams.- User accepts organization access
- User is redirected to the main application under the context of an organization
The issue I’m facing is when I log out and try logging back in. After entering my email and password, I get “Wrong email or password”. I verified the organization is using the same database connection as my two applications, and both applications have the database connection enabled, and the user is a member of the organization. Authentication Profile is also set to “Identifier First”.
Am I missing something here?