Add enterprise user on first login as member to org

Hello

To add new members to an org the flow we want is:

  • a customer admin application used to invite enterprise user (not using auth0 invite).
  • Will send an email containing login url that includes the users organizationId
  • user clicks login link, authenticates through their orgs idp. auth0 creates a user
  • a post-login action then attempts to add user as a member to organisation.

I’ve tried based an action similar to this post Is there a way to add a Social Login user to a role or org before they sign in the first time?

BUT when user logs-in receive failed login error that user not part of organization. The user account is created but not added as a member. I’m confused how that post I linked to works in this case.

Note organisation with auto member enrolment is disabled as we don’t just want any one being added as a member.

Is there a way to implement this without using the auth0 invite flow?

Thanks

@authdev1 did you manage to implement this somehow? thanks in advance!

1 Like

I would love a reply to this!

I want to set up this flow with Business Users (not Both) and I cannot figure it out.

Can anyone help?

If you are using the Organization feature, this process becomes easier. You can add the organization during authentication and enable auto-membership in the organization. This way, users will be automatically added to the organization after authentication.

Note:

You have to add org id in Authorization parameter in your code.