Dynamically assign Access group
I am using an authe service rule to establish SAML based SSO authentication. I provision user through a model operator. In ApplicationProfileSetUp extension point I call a service to obtain the user roles. Based on the user roles I need to decide whether I should show developer portal or user portal.
What I am doing now:
In model operator I have added 2 access groups - one as MyApp:Developers and the other as MyApp:Users. Once I get the user roles by calling the service I do the below 2 steps in sequence
- Call OOTB activity RedirectAndRun and pass Access group Parameter as MyApp:Users (beased on detected roles)
- Inject roles dynamically by calling OOTB API tools.getAuthorizationHandle().setRoles(tools, PRAuthorization.UPDATE_APPEND, tools.getStepPage().getProperty(".ListOfRoles"))
Problem Facing:
Access group is righly switched, but the roles are not getting added. If I stop call RedirectAndRun then roles are rightly added in the user profile.
What I need:
Both should work - Launching of the session with correct AG and poper allocation of roles.
Please Note : Since my application is hosted on tomcat cant use EstablishOperator (as that is for container managerd apps)
Thanks for any lead
Sayak
***Edited by Moderator Marije to add Capability tags***