Service Portal Logout Redirect Issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 08:32 AM
Hello All,
We have a below requirement,
- If user with role(s) login they should see the ServiceNow page - Achieved
- If user with no role login they should be redirected to service portal page.- Achieved
I used the below code in SP entry page(60 to 69) and activated the below properties,
- PROPERTY VALUE
- glide.entry.page.script new SPEntryPage().getLoginURL();
- glide.entry.first.page.script new SPEntryPage().getFirstPageURL();
getFirstPageURL: function() {
var session = gs.getSession();
this.logProperties('before', session);
var check = session.getRoles();
// has roles and is not a Service Portal page - go to UI16
var nt = session.getProperty("nav_to");
var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt);
var redirectURL = session.getProperty("login_redirect");
if (check && !redirectURL && !isServicePortalURL)
return;
Issue: When the user without a role logs in first and logout, then the user with a role(s) logs in then they are viewing the SP home page. The landing login page seems to have '/sp' as the suffix and even when if the suffix is cleared it still redirects to the service portal for the user with a role(s) after log in, until I clear the cache of the browser (here: google chrome)
Can somebody comment on this behaviour?
Thanks and Regards,
Mohammed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 10:07 PM
Hello Mohammed,
I hope you should find your answer here 6 ways to set up your Service Portal for redirection SUCCESS!
Let me know if it helps!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 10:11 PM
Hello Mohammed,
Refer the below links may helpful to you.
6 ways to set up your Service Portal for redirection SUCCESS!
The thing about redirecting to the Service Portal
ServiceNow Commnunity MVP -2018 class.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-22-2017 10:39 PM
Hello Mohammed,
Use this property and make the value as true.
"glide.service_portal.use_login_redirect_script"
which will redirect users to sp who don't have any roles.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 07:28 AM
I have the same issue.
were you able to resolve the issue?
please suggest.
Thanks