How to restrict end users from accessing portals other than the portal they belong to?

Akhil Pendem
Tera Contributor

Hi All,

We've this requirement.

We have 3 customer service portals for 3 companies and an internal portal.

let's consider "/aa" , "/bb" and "/cc" are the url suffixes for the 3 customer portals and the internal service portal with url suffix "/sp".

The portal url would be something like this -- > https://<companydev>.service-now.com/aa. or /bb or /cc
Instance URL is https://<companydev>.service-now.com.

So if an end user 'A' belonging to "/aa" gets curious and removes the url suffix , that'd take the user to the instance UI (which is not desired).

Here comes the requirement:
if the loggedIn user removes the url suffix and clicks enter, the user should be redirected back to the respective portal "/aa". It should be same case if the user 'A', changes the url suffix with "/bb" or "/cc".

 

6 REPLIES 6

Michael Fry1
Kilo Patron

You can apply a role to the index pages to prevent that from happening. Just make sure to tell your SN rep so they don't count the new roles as licenses:

 

find_real_file.png

Hi Michael,

 

Thanks for the response.

I guess adding the roles to the index page will just show a 404 page for the users (without the roles) under the header of other portal. But we need to redirect the loggedIn user to respective portal even if the url is changed.

You can also add User Criteria which don't rely on roles: https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/build/service-portal/concept/user-criteria.html

sahana13
Tera Contributor

Create UI script and check the logged in user role and the current page using window.location. And redirect to the respective page if the condition does not meet.