Redirect user to different service portal based on role or email id domain

Navneet Arora
Mega Expert

Hi  All,

I have to redirect users to a new/different portal already existing based on their email address domain.

For e.g. 

There is an existing Service User portal - Portal1 which doesn't have user specific redirection. We have another portal- Portal2 which is a new portal.

If a user email address is test@abc.com and he tries to login in Portal1 then he should be redirected to Portal2 which is our new portal because his domain is @abc.com else if he is any other user who doesn't have domain of @abc.com he should be redirected to default portal i.e. Portal1 being used.

 

Regards,

Navneet Arora

5 REPLIES 5

This article is for Setting this script up to redirect to multiple portals based on roles/domains is not be covered there

that is covered

 

Setting up a role-based redirection

If you want to be specific with directing certain roles (not just users without any roles) you can modify the SPEntryPage script include to meet your needs. It would be worth your time to also check out kobby.adu-nti's blog on overcoming issues with role redirection with the SPEntryPage

Modifying the SPEntryPage script will set sys_customer_update to true and sys_replace_on_upgrade to false.

 

In the SPEntryPage script on lines 69-70, you will see where we check for any roles (not specific roles) and whether it's a redirect URL or if the user is trying to access the portal directly.

image

 

Here I have commented out these two lines (to keep the original code) and added a specific role(s) check by using hasRole()

image

 

This will allow users who have admin (because hasRole automatically passes admin as true) and snc_123 roles to go directly to UI16, all others will be reverted to the Service Portal. Again, this is just an example but provides you with a starting point to configuring your redirection.

Chalan B L
Giga Guru

Hello Navneet,

 

You should play around with the script include: SPEntryPage

Where this is the core logic where it works for the redirection but please do try in your PDI as this is a little crucial to do directly in the instance.

 

Mark helpful/correct if it helps !!

 

Regards,

Chalan