We are planning to use service account for API calls, hence there is a requirement to switch access group of the service account dynamically runtime.
PEGA invokes InitialProfileSetup(Final), ApplicationSetup(Extension available), ApplicationSetup(Extension available) during API calls if the APIs are secured.
I tried to save the above extension activities under unauthenticated ruleset , my application ruleset and try to run the java code that switches access groups . But the ruleset stack does not pickup neither unauthenticated nor the application rulesets.
I tried to add the access groups on to my Requestor Types, updated the service package access group etc. but the ruleset stack does not seem to reflect this.
Any thoughts ?
***Edited by Moderator Marissa to added Capability tags***
@GunaSekaran_B Thanks for your reply. I already have this java code. My question is different, what is the ruleset that I need to check-in this code in to ? Is it unauthenticated ruleset or application ruleset ?
Unfortunately, neither of them worked.
You could place the java code in your first step of service activity and dynamically change the authorization context (it should be in application rule-set).
Instead of placing the java code in any service pega OOTB activity extension place, you could place the logic in respective service activity itself. If you are placing the logic in any OOTB extension point then you might need to handle lot of exceptions, for other services/pega OOTB services which all you are using inside your application should not get affected because of this authorization context change logic.
Just the major configuration which we need to take care from our side is with the same name and and in same class we need to have the activity in all application(s) rule-set.