Restrict Portal Users from go to Now platform.

rohanbhatia
Tera Contributor

Hi,

We want to restrict Our portal Users (CSM portal) to go to Now Platform. 
We have a UI script and modified spEntryPage as well.
UI script currently works well when someone removed  "/csm" and spEntryPage redirects users to the right portal.
Problem is when someone copy pasted url like "now/nav/ui" or "now/sow/home" they get access of now platform.
We want to restrict it and redirect them again to CSM Portal.

6 REPLIES 6

Dr Atul G- LNG
Tera Patron

Hi @rohanbhatia 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746730

 

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/dratulgrover [ Connect for 1-1 Session]

****************************************************************************************************************

Ankur Bawiskar
Tera Patron

@rohanbhatia 

the same UI script you can use to enhance and if they visit platform inform them and redirect to portal

share your current UI script

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

var chkGRP = new GlideAjax('abc');
chkGRP.addParam('sysparm_name', 'checkGroupMembership');
chkGRP.addParam('sysparm_function', 'user');
chkGRP.getXMLWait();
redirect(chkGRP.getAnswer());

function redirect(answer) {
    if (answer == 'true' && document.URL.indexOf('/csm') == -1) {
        window.location.href = '/csm';
    } else return;
}

@rohanbhatia 

here you are checking some user and if the index is not CSM then taking them to CSM

So you want user should never navigate to native and should always be taken to CSM?

for this the above code is not working?

Even if user navigates to now/sow or any other page it should work

share your UI script complete config screenshot and complete script

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader