Redirect user to a specific portal if user has certain role

Utpal Dutta
Tera Guru

Hi community members,

 

I want to redirect all the users who have (xyz) role and logging into our Dev instance to a specific portal (onboarding). I am able to do this when user 1st time logs in without any specific portal URL defined, after login when I remove (/onboarding) from the URL and hit enter the user is able to see the backend. (This is the issue!!!)

 

I do not want users to see the backend even if they modify the URL and tries to see the backend of ServiceNow. User with (xyz) role should always see the (onboarding) portal only.

 

Please help me achieve this functionality!

1 ACCEPTED SOLUTION

Utpal Dutta
Tera Guru

Well this UI script worked for my requirement. I figured it out on my own.

 

Screenshot 2022-11-13 at 9.25.37 PM.png

View solution in original post

5 REPLIES 5

Tony Chatfield1
Kilo Patron

Hi, I think you will find this is OOB via the script include SPEntryPage

/nav_to.do?uri=sys_script_include.do?sys_id=3647c37253221200b0b0547cedc587fd
Try this first, and if it does not deliver required result you can also use a UI script, but OOB should always be your first choice.

Hi Tony,

Thanks for your swift reply. I looked into the script include but it only redirects the user when the logs in. If user modifies the URL after logging in then he/she is able to see the backend view. 

I want user to be redirected every time they try to see backend view. To be precise, user should never see backend.

Utpal Dutta
Tera Guru

Well this UI script worked for my requirement. I figured it out on my own.

 

Screenshot 2022-11-13 at 9.25.37 PM.png

Community Alums
Not applicable

Hi @Utpal Dutta , May I please know from where you are calling the UI Script?