Add Organization Roles and Permissions to the SAML Response
Last Updated:
Overview
Is there a way to add organization roles and permissions to the SAML response?
Applies To
- Roles
- Permissions
- SAML response
Solution
Here's an example:
exports.onExecutePostLogin = async (event, api) => {
api.samlResponse.setAttribute('roles', event.authorization.roles);
};
There is no ideal way to add permissions. It is possible to retrieve the permissions for a given role using the GET permissions granted by role endpoint, but this is costly to do in an action, especially in the case of multiple roles as a separate call will need to be made for each.