I am trying to use Auth0 to manage users for a developer portal. I am using the Authorization Extension to add groups and roles to users. Upon sign-up, the user enters an email, password and a group name. The backend makes several calls to Auth0 using the auth0-nodejs library and calls to the Authoziation Extension API:
- Add user to the Auth0 connections database
- Create a new group (in Authorization Extension)
- Add user to group (in Authorization Extension)
- Add a (predefined) role to the user (in Authorization Extension)
Once this signup process is complete, I want to make a call to Auth0 to get a JWT token for the user, so that I can sign them into our frontend app. In Auth0 I am using a Rule that populates the users login JWT with group and role information from the Authorization Extension.
I am getting an issue where the JWT returned by this login call does not always include the newly created group and role information. It happens about 1 in 3 signup attempts. Manually looking in the Authorization Extension, I can see that the user data has been correctly created. Is this just an issue with synchronization? Has anyone encountered an issue like this before?