Redirect users with roles to Employee slate rather than SP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi,
Does anybody know a clean way to implement the redirection of users without roles to employee slate rather than SP.
Does modifying the glide.entry.page.script the only way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
You can use Single Sign-On (SSO) to handle this redirection seamlessly . It is one of the cleanest enterprise-level methods because it offloads the traffic control logic to your identity provider (IdP) rather than forcing ServiceNow to evaluate scripts post-login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Yes, the entry page script is the clean way to do it. Just don't modify SPEntryPage directly; extend it instead.
- Create a script include, for example SlateEntryPage:
var SlateEntryPage = Class.create();
SlateEntryPage.prototype = Object.extendsObject(SPEntryPage, {
getFirstPageURL: function() {
var navTo = gs.getSession().getProperty('nav_to') || '';
var isDeepLink = navTo && navTo != 'welcome.do';
// Users with roles and deep links keep OOTB behaviour
if (gs.getUser().hasRoles() || isDeepLink)
return SPEntryPage.prototype.getFirstPageURL.call(this);
// Roleless users go to Employee Slate
return '/aiux/employeeworks/home';
},
type: 'SlateEntryPage'
});- Set the system property glide.entry.first.page.script (create it if it doesn't exist) to:
new SlateEntryPage().getFirstPageURL()
Check your Slate URL in the Admin Console before using it. If everyone logs in through SSO, you can set the landing URL in your identity provider instead.
Hope this helps.