Hi,
This is my first post here, so hello!
I wanted Roles populated in the JWT for my Application so I wrote a custom Action and used it in a Login Flow. It works fine. A question I have is about the Javascript. I used the code from this example in the docs, however I want to exclude the namespace so the function will look like this:
exports.onExecutePostLogin = async (event, api) => {
if (event.authorization) {
api.idToken.setCustomClaim('roles', event.authorization.roles);
api.accessToken.setCustomClaim('roles', event.authorization.roles);
}
}
For some reason this doesn’t work without the namespace being appended to roles (as in the docs example). These setters are setting values in a simple map (I assume) so why doesn’t my code without the namespace work?
Thanks