Closed Calion54 closed 6 years ago
Which scope are you setting in your lockjs config??? Example config:
var options = {
auth: {
params: {scope: 'openid email user_metadata app_metadata picture'},
}
};
Yes, I tried with your config but there is no change to the payload structure. I do not use the lock but directly auth0-js
"If your authorization context is large (for example, the user might belong to many groups or have been granted many permissions), you might find it useful to store some of the authorization content in the users' profiles. This allows you to store less information in the token, which means you're less likely to see performance-related issues or even problems with token issuance. Persistence is the process by which you store groups, roles, and permissions information in the users' profiles.
The data will be stored in the user's app_metadata field, and you can then use the Management API or the Dashboard to retrieve this information after the user has logged in." (https://auth0.com/docs/extensions/authorization-extension/v2/implementation/configuration)
So, actually, the roles are fine in the app_metadata object but I have an extra object level. He adds me "Authorization"
Are you sure that the library is still up to date with their "Authorization Extension" system ?
Fix with #42
Hi,
I use authorization extension, I inherit from your class "HasRoleBasePermission" but it throws an exception. Indeed, the array of the roles are not in the field "app_metadata" but directly at the first level of the object payload. Is it normal for me to have the array at this level ?
Best regards,