Question

Anonymous user to authenticated user - session refresh
Hi,
We are working on a requirement to trigger authentication mechanism for anonymous user (unauthenticated user) by launching local action pyReAuthGadget to capture user credential and to authenticate the user.
On post submit of this local action, expected scenario is the browser session will be refreshed and then authenticated user portal is displayed but no browser refresh is happening, unauthenticated user portal stays the same.
To refresh the browser session post submission of local action, we included reload harness and window.location.reload() as well, still there is no session refresh.
Any solution to overcome this issue?
Thanks!
Pega platform version - 8.4, 8.8
-
Likes (1)
-
Accepted Solution

@bhavanasahithitested this solution and it worked for me:
1. first add script to UserWorkForm
2. add Run script action to your button. The function name is reloadBrowser
ref: https://support.pega.com/question/how-refresh-browser-clcik-button

@Anoop Krishna No, I didn't find any solution

@bhavanasahithiHi, did you find a solution to this? We are having the same issue
Accepted Solution

@bhavanasahithitested this solution and it worked for me:
1. first add script to UserWorkForm
2. add Run script action to your button. The function name is reloadBrowser
ref: https://support.pega.com/question/how-refresh-browser-clcik-button

Hi, As suggested we included reloadBrowser function in UserWorkForm and called the function after Re-auth action. This didn't work
Approach-1: Added reloadBrowser function after launching pyReAuthGadget. Post submit of this local action no browser refresh is happening.
Approach-2: In pyReauthenicateForBasic section - Login button action set, added reloadBrowser function.
With this approach, getting following error due to stale transactions.
"This action is not allowed as it is outside the current transaction"
Also we replaced reloadBrowser function with ReloadHarness activity to refresh portal harness. This too didn't work. "This action is not allowed as it is outside the current transaction" message is displayed.

@bhavanasahithiThe approach 2 seems to be right. I'm using the same approach and it did not give me that error. Is your action calling reloadBrowser first then refresh section (which is OOTB and should be there when you did save as)

Hi @ChensuZ5,
Thanks for the solution! We are able to resolve this issue.
Previously we placed the Login button (that launches pxReAuthGadget local action) in temporary work flow context, which resulted in stale transaction. To overcome this we placed the login button (that launches pxReAuthGadget local action) in portal header, browser refresh is working successfully.

@bhavanasahithi great to know you have fixed issue. So you have not used login button in ootb section pyReauthenticateForBasic section ?

We updated pyReauthenicateForBasic (one of the calling section in pxReAuthGadget local action) - Login button action set, to call reloadBrowser function.

@bhavanasahithi pyReauthenticateForBasic section is available, pls save as and add your refresh and other configuration in the login button.