Lets take the below scenario:
SP and CSM are the two portals.
CSM portal is used by the role sn_customerservice.consumer and SP portal is used by other end users (no role).
For admin user and other role based users, they should be landing on the native UI.
All supported releases
This can be achieved by cloning the OOB SPEntryPage. Once the custom script include is created, you need to modify the below system properties:
Modify line 69 as below:
gs.log("Admin Redirection 1");
else if (user.hasRoles() && !redirectURL && !isServicePortalURL)
else if (user.hasRole('sn_customerservice.consumer') && !redirectURL && !isServicePortalURL)
else if(!user.hasRoles() && !redirectURL && !isServicePortalURL)
Here you need to make sure that the hasRole check for admin user should always be the first if condition.
gs.hasRole returns true for any role for an admin user.
This is an expected platform behavior.
Here you want also want all the users to have a common login page, and the redirection should happen after login.
In that case, you can remove the Login Page from the portal records, so that all the users land on login.do
Also, you need to change line 22 on the custom script include from:
this.portal = "/sp/";
this.portal = "/login.do";
IMPORTANT - The changes mentioned in this article would come as a customization, and is out of scope of support. These changes should be validated on higher instances to check the compatibility.