Non - ITIL users are not redirecting to Service Portal Automatically

venkatesh76
Tera Contributor

When a non - itil user logged into servicenow, he should automatically redirect to service portal. But its not happening,

 

As per my knowledge, this is something we have earlier in servicenow. But currently is not in place.

 

Can anyone help me how to achieve this functionality?

3 REPLIES 3

jMarshal
Mega Sage
Mega Sage

You can create some records on the System Properties [sys_properties] table to redirect a user with no roles (NO roles beyond "snc_internal" or "snc_external) to the SP. This will require additional configuration, if the user has some other role which is not ITIL, like "approver_user", for instance.

https://docs.servicenow.com/bundle/washingtondc-platform-user-interface/page/build/service-portal/co...

 

jMarshal_0-1713966860232.png

 

Nikhil Soni 007
Giga Guru

Please update SPEntryPage Script include according to your requirement.

 

 

Amit Pandey
Kilo Sage

Redirect to Service Portal after login

Conditionally redirect users to a Service Portal page after logging in.

Before you begin

Role required: admin

Procedure

  1. Enter sys_properties.list in the navigation filter.
  2. In the System Properties [sys_properties] table, add the following properties and values.
     Property Type Value Description
    glide.entry.first.page.scriptstringnew SPEntryPage().getFirstPageURL()First page after authentication
    glide.entry.page.scriptstringServer script that redirects users to where to log in. For example:

    new SPEntryPage().getLoginURL()

    Contains the call to the server script include method that determines where to log in
    getFirstPageURL primarily does the following:
    • Redirects to login_redirect.do to break out of the frameset (if there is one).
    • Redirects to the default portal if the user has no roles or to the full platform for users with roles who are not trying to go to a portal directly.

      When the user has no roles, they are redirected to the portal equivalent of a page. For example,

      https://<instance_name>.service-now.com/nav_to.do?uri=change_request_list.do

      sends users without roles to:

      https://<instance_name>.service-now.com/sp/?id=list&table=change_request.

    Note: This change does not prevent users without roles from accessing the full platform. To prevent users without roles from accessing the platform and always redirect to a portal, set the value of the glide.entry.loggedin.page_ess system property to the portal suffix, such as /sp.
  3. (Optional) Customize the after-login behavior in the SPEntryPage script include.

    For more information about modifying script includes, see Script includes.

    For example, if you want users with certain roles to be redirected to Service Portal, you could modify user.hasRoles() in the following code.
    if (user.hasRoles() && !redirectURL && !isServicePortalURL)
     
    Note:
    • If you edit the script include, it won't be upgraded with future updates.
    • Users with the admin role always pass a user.hasRoles() check.
    • If you are using external authentication, ensure that your IdP supports the RelayState URL parameter. This parameter retains the originally requested URL while the user authenticates, and is necessary for redirection after login.

What to do next

To debug redirection, see Debug Service Portal URL redirects. For additional redirection troubleshooting information, see the Frequently Asked Questions on redirection with service portal [KB0747432] article in the Now Support Knowledge Base.

Debug Service Portal URL redirects

Debug the URL redirects for logging in to Service Portal and redirecting to the first page.

To view debug output from SPEntryPage and see the session variables it redirects based on:
  1. Make sure the system property glide.entry.first.page.script has the value: new SPEntryPage().getFirstPageURL().
  2. From the SPEntryPage script include, set this.logVariables = true.
  3. In a separate browser, log in.
  4. From the system navigator, view the log output by navigating to System Logs > System Log > All.