Hello,
I added Auth0 login but I cannot retrieve the role and permissions of the user. Following is implemented already :
- Auth0 : audience is setup
- Auth0 : RBAC is enabled
- Auth0 : Add permissions in the access token is enabled
- Auth0 : user role is granted
- Auth0 : user permissions are granted
- Auth0 : code snippet in post-login action flow
- WeWeb : setup is done
I was in touch several times with Auth0 support but they have not been able to replicate the issue and told me issue was most probably on WeWeb side - which is not very helpful.
I followed this ressource which was provided by Auth0 support : Adding Roles to User Access Token in Auth0 | by Siddharajsinh Rathod | Medium
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'your_name_space';
if (event.authorization) {
api.accessToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
}
};
Do you have any clue about the root cause of this issue please ?
Cheers,
P-H