Service Portal - Configured SpEntryPage user redirection does not work


When a user logs out from native UI/from any other portal and login again in same browser, the system navigates to the page from where the user logged out, instead of considering the configured SPEntryPage after each login.

Steps to Reproduce

Set the system property = new SPEntryPage().getFirstPageURL()

Scenario 1:
1.1. Login the instance with ess user, it redirects to the /sp page
1.2. Manually navigate to /kb page or /cab page
1.3. Logout from /kb or /cab page
1.4. Login in the same browser, it redirects to /kb or /cab page
1.5. In case the banner header shows messed up, refresh the browser (PRB736834/KB0717896).

Scenario 2:
2.1. Login the instance with itil user, it navigates to Platform UI
2.2. Manually navigate to /sp page
2.3. Logout from /sp page
2.4. Login in the same browser, it navigates to /
2.5. Refresh the browser, it navigates to /sp page where the banner displaying properly.

Overall, it will navigate to the page from where user logged out, which seems to contradict the definition of SPEntryPage ("Follow these steps to redirect a user to Service Portal after they log in"):


This is expected behaviour. When the user is trying to access the platform URL, the SPEntryPage, when configured, will redirect to the platform only if the user has any roles, otherwise it will redirect to the portal.
If the user goes to another portals like /cab or /kb, and then logs out from there, will be landing onto the portal logout page. If the user then logs in from there, will be going to the respective portal page, not /sp.

NOTE: SPEntryPage will come into picture only if users are trying to hit a platform URL.

Related Problem: PRB1363222