Redirection to two different portals based on role or company

mattmm
Kilo Sage

I have two seperate portals configured in Servicenow. 

One internal using Single Sign on with AD users. With these users they are split into ITIL or non ITIL users

Internal

Non itil role users are redirected directly to /sp portal when entering our instance URL

Itil role users are redirected to the backend of ServiceNow

External

This external Portal is called (for example) /newportal

It requires Authentication via the ServiceNow login and my users are manually entered into Servicenow without the itil role and with a seperate newportal role. These Users have a specific newportal role and a newportal company assigned to them. I have locked down all pages etc. between these two portals so one cannot access the other in any way.

THE ISSUE

When my External users log in with their creds to https://myinstance.service-now.com/newportal it logs them in fine, however if they then drop the /newportal suffix, it redirects them to my internal Servicenow instance backend!!!

This is despite the fact that they are non Itil users!! It is like it is cacheing the credentials somehow externally and ignoring the fact they are non itil users.

I want to setup my spentry page to recognise each of the two roles and redirect to either /sp or /newportal dependant on the role. but is this page used if I am doing SingleSignOn internally?

I can see this in the SpEntryPage Script Include has this entry.....

if (user.hasRoles() && !redirectURL && !isServicePortalURL)
    return;

I am very flaky on what to put here, but can anyone help me with the code to redirect to two different portals based on someones role. Or is there a much better way to do this?

5 REPLIES 5

Matthew Glenn
Kilo Sage

Not sure if you've seen this post in your searches. I used it not too long ago to set redirects to different portals for users based on an attribute on their company record.

You may need to tweak a little bit of what's shown in the accompanying video, but the basic principles are there. 

anusarma
Kilo Expert

Hi @mattmm,

We are having a similar requirement. We need to provide roles to external users and they need to land to the new portal only upon login. We are finding issues with redirecting these users to the new portal as they are having some role and the SPentryPage script include directs users with role to the ServiceNow instance view. Could you please let me know how you had configured this and the fix for this issue?

Thanks in advance,

Anu

shubham1985
Kilo Explorer
Hi, I have a basic question, sorry i am new to servicenow, how can i first have two url’s for internal and external servicenow users. This is because i have two IDP’s to handle both internal and external users authentication in a different way

Meenal Gharat
Giga Guru

Hello matt,

We are stuck with similar type of requirement. Did you found any solution on this?

Best Regards,

Meenal Gharat