Dear Auth0 community,
We are seeking some help concerning one of our use cases as we have been stuck for more than a week and have tried every resource at our disposal. Basically, we are trying to pass a
user_type parameter to the social sign-up on the new ULP to allow us to differentiate the type of user that is created in our system. We are currently using the nextjs-auth0 library to handle the authentication process through auth0.
One of the attempts we tried is to pass the
state parameter to the
authorize API. Although we were able to get the
user_type in the state, it seems that the state is used by auth0 to prevent csrf attack, thus the state becomes invalid when it returns to us. As such, we had to switch to a different approach.
We tried another approach described by other threads post from 2019 that made use of the
authParamsMap as found here, here, and here. After countless attempts and tweaking in the post actions, it doesn’t seem that the parameter is being passed to the context query anymore.
We later tried yet another approach, which is to redirect the user to a specific
callbackUri, for instance
https://example.com/auth/type2_callback after the user finishes authentication depending on the selected user type. However, passing the
callbackUri to either the
authorize or the
webAuth params doesn’t seem to do anything as the user is simply redirected to the default
https://example.com/auth/callback URI. Furthermore, dwelling in the obscure
appState parameter to try overriding the
returnTo parameter did not yield any success neither.
We are currently stuck on this issue and we would appreciate any help from the community or the Auth0 staff. Thank you.