I’m trying to write a rule that will assign a role to a user upon login. I’ve worked through several of the different examples & community posts, but I cannot find a way to access the role ID’s programmatically in the hook function.
The ManagementClient access tokens that are available in the rule do not have
read:roles permissions, so I can’t use the
getRoles() method. Alternatively, I’ve seen a post for finding the role ID manually (Assign Roles to users using Rules), but in our situation, we’re launching tenants on-demand via terraform, so we won’t have the ability to manually track and update these IDs.
Are there workarounds that I’m missing?