John_Yates
ServiceNow Employee
ServiceNow Employee

KH_MFA_UserReset_Banner_20250811.png

 

Service Portal brings your enterprise applications into a streamlined user experience. So why not make it your default login page? This article shows you how to use the SPEntryPage script include to configure the Service Portal as the primary login page for your instance.  

 

Before you begin

  • Target role: Administrator
  • Experience required: Knowledge of SSO, URL redirects, and the ServiceNow platform 

Note:  This article is part one of a series on configuring the Service Portal login using the SPEntryPage script include. 

 

Configure the SPEntryPage script include

The SPEntryPage script include is like a login handler for the Service Portal to establish the destination URL for user login. You can configure the Service Portal page to include the login widget or the default landing page.  

 

Note: This setup applies to all unauthenticated users. Different login experiences based on roles can’t be established prior to authentication.  

 

1. Go to the sys_properties table and find the glide.entry.page.script property. 

If the property does not exist, create it as a string type. 

2. Set the property value to new SPEntryPage().getLoginURL().

This change directs the platform to use the SPEntryPage script include to determine where users log in and uses the default portal, unless you make changes described in the following step.

3. Open the SPEntryPage script include and edit line 22.

4. Replace /sp/ with the URL suffix for your portal instead of the default value sp.

SSO tip: The slash character (/) after /sp may cause issues when configuring single sign-on. If you experience issues, try removing the character from the script.

SPEntryPageScript_69_70.png

This is a supported customization. However, when you upgrade your instance, remember that modifying the SPEntryPage script include sets sys_customer_update to true and sys_replace_on_upgrade to false. It won’t be upgraded with future updates.

 

Configure the login page for your portal

1. Go to the sp_portal table and open the portal you want to use for login.

2. Verify that the Login page field is set to the page you want to use for login.

3. The login page must include the login widget or the default landing page.

ServicePortal_sp_portal table.png

 

 

Wrap-up

The SPEntryPage script include gives you flexible control over how users are redirected in the Service Portal. By following supported customization guidelines, you can tailor login experiences for different roles while keeping your instance stable and upgrade-safe. For more advanced configuration or troubleshooting, explore the links under Additional Resources.

 

Important notes

  • The SPEntryPage script include is not intended as a secure means to prevent users from accessing the platform UI. For example, users with the admin role will always pass a hasRole check even if they do not have a specific role being checked.  
  • Redirection between multiple portals is not supported. 

 

 

Additional resources  

 

Version history
Last update:
‎11-10-2025 07:08 AM
Updated by: