Hi!
I need to retrieve the user assigned roles on login. I have added an action that adds a custom claim as follows:
exports.onExecutePostLogin = async (event, api) => {
const namespace = 'https://example.com';
if (event.authorization) {
api.idToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
api.accessToken.setCustomClaim(`${namespace}/roles`, event.authorization.roles);
}
}
However, the access token gives
"https://example.com/roles": [],
I am using organizations. I have also activated RBAC in my default audience api and the permissions claim is empty as well.
"permissions": []
Any idea of what is causing this?