Hi,
I am using PASOE 11.6 to handle REST calls with Form based authentication. So the REST manager provides me with a sealed client-principal instance that I can query with
ASSIGN hPrincipal = SESSION:CURRENT-REQUEST-INFO:GetClientPrincipal().
All working fine.
I have a use case, where the user is able to change the login company through an application function. I tried to create a new CP with different user/domain name values and assign that using:
SESSION:CURRENT-REQUEST-INFO:SETCLIENTPRINCIPAL (hNewCP) .
But with the next request, I am still getting the original CP returned.
Is there any way to replace the Tomcat generated CP from ABL code to update it's attributes?
Regards,
Mike
You need to set it via SESSION:CURRENT-RESPONSE-INFO and not CURRENT-REQUEST-INFO if you want the C-P to be returned to the client.
Thanks Fernando, tried that now. But on the next request, I am still having the old user info in the CP.
DEFINE VARIABLE hNewCP AS HANDLE NO-UNDO. DEFINE VARIABLE hCurrentCP AS HANDLE NO-UNDO. ASSIGN hCurrentCP = SESSION:CURRENT-REQUEST-INFO:GetClientPrincipal(). CREATE CLIENT-PRINCIPAL hNewCP ASSIGN DOMAIN-NAME = "xyz" DOMAIN-TYPE = "OEApplication" QUALIFIED-USER-ID = "42@xyz" ROLES = "ROLE_PSCUser" SESSION-ID = hCurrentCP:SESSION-ID USER-ID = "42" . hNewCP:SEAL ("secretseal") . SESSION:CURRENT-RESPONSE-INFO:SETCLIENTPRINCIPAL (hNewCP) .
[quote user="Peter Judge"]
[quote user="Peter Judge"]