Hi @ovezovv,
Thank you for your response.
The Rule snippet you shared with me will get the permissions and roles of the user Post-Login and append them to the ID Token. There should not be any additional configuration needed.
You could alternatively use the Management API v2 Get a user Role endpoint and Get a user Permissions endpoint to accomplish the same results.
Hoped this helps!
Please do not hesitate to reach out if you have any further questions.
Thank you.