How to restrict end users from accessing portals other than the portal they belong to?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 08:31 AM
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".

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 09:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 10:40 AM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 05:16 PM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2018 10:56 PM
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.