5 Replies · Latest reply on Jan 3, 2018 1:00 PM by Brian Shaw

    Service Portal Logout Redirect Issue

      Hello All,

      We have a below requirement,

      1. If user with role(s) login they should see the ServiceNow page - Achieved
      2. 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,

      • 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)

      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,