we have a React (Typescript) application with Universal Login. The user login works perfectly. But we would like to assign roles to user on first login.
We followed this video: https://www.youtube.com/watch?v=B5pzpPqPbbM
We tried login from Dashboard (like the lady in the video) and it worked. But when we try to login in our React app with the universal login it does not work.
We get back an unauthorized error.
To make Post-Login action to work we had to set “Authentication Method” from “None” to “Client Secret (Post)” and in the Settings → Advanced Settings → Grant Types we checked “Client Credentials” option.
If we switch from “Client Secret (Post)” to “None” then the login works but the action does not (we got the following error: AuthApiError: Grant type ‘client_credentials’ not allowed for the client.\n at OAuth.parseError (/data/layers/layers-GH-v/GH-vlzQIts7oMVQoMATHHepPqgU7LvJnMmf-9-IHPrA/node_modules/auth0/dist/cjs/auth/base-auth-api.js:43:16)\n at process.processTicksAndR").
So we basically would like to solve that when a user logs-in first time he/she gets his/her roles automatically.
Can you tell the steps we have to make both (login and action) work?
Thank you for help!
You can achieve that by following the steps
"None"
. This will handle your login."Client Secret (Post)"
. That will give access to the Auth0 Management API.Now you have two APPs but the same API