- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 12-02-2020 10:01 PM
This article is basically to configure domain separation for Service Portal.
Till date ServiceNow hasn't provided solution for Domain Separation for Service Portal.
Which mean: Your instance is domain separated and you have two or more than 2 domains, each having separate Service Portal.
User from X domain has Service Portal (URL suffix: xyz) and users from A domain has different Service Portal (URL suffix: abc).
So if somehow user from X domain knows the Service Portal URL suffix for A domain then he will be able to create incident/request, view knowledge articles of A domain which is a security breach.
This article will help you to restrict users to their domain Service portal only. Even if user tries to access the other domain portal, he will redirected to his domain Service Portal
All you need to do is:
1. Create a Script Include to check if the user is from particular domain
Name: getMyPortal
Client Callable: true
var getMyPortal = Class.create();
getMyPortal.prototype = Object.extendsObject(AbstractAjaxProcessor, {
xPortal: function() {
var dom = gs.getUser().getDomainID();
if (dom == '<sysID of the domain X')
{
return true;}
else
return false;
}
});
2. Create UI Script
UI type: Mobile/Service Portal
(function() {
var ga = new GlideAjax('getMyPortal');
ga.addParam('sysparm_name', 'xPortal');
ga.getXML(NewParse);
function NewParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
if (answer == 'true') {
window.location = '/xyz';
}
}
})();
portals;
3. Create new JS include in the theme related list of Portal A and add the UI script there
Note: This solution is for one domain redirection. that means if user from X domain tries to access abc portal, he will be redirected to xyz portal.
In order to the redirection for abc portal also, you have to create another Script include to return the abc domain and then create another UI script which you will add to xyz portal theme.
- 1,569 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi,
Im am trying to do the same thing. Has this solution worked for you?
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Christopher,
Yes, the solution worked for me.
Please follow the same steps as mentioned above.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi @vivian08081
For step3, open the theme of other service portals and go to the JS include related list and create new
Select the UI Script created in step2
Let me know if still you have any doubt
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content