Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
After logging in via the Service Portal, user is redirected to 'modalLogin'. - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • After logging in via the Service Portal, user is redirected to 'modalLogin'.
KB0688293

After logging in via the Service Portal, user is redirected to 'modalLogin'.


2267 Views Last updated : Apr 7, 2024 public Copy Permalink
KB Summary by Now Assist

Issue

Symptoms


After using the Service Portal to log into the instance, the relay URL sends the user to a page called 'modalLogin'.  Expected behavior is that the user is redirected to nav_page. 

Cause


The 'Stock Header' widget has an angular ng-template called 'modalLogin'.  If the template is no longer associated to the widget, instead of calling the template, the widget tries to navigate to 'modalLogin', which adds that to the Relay State.  After getting authenticated, the user is sent back to the 'modalLogin' page.

Resolution


 
In the Service Portal, the header bar which contains the 'Login' link is called the "Header Widget" -- it is a widget specifically designed to be the Service Portal's header.  Out-of-box, this widget is called "Stock Header" and can be found in the sp_widget table.
 
The reference field which determines which widget the Service Portal uses is found in the Portal's Theme.
 
To get there:
 
1.  Determine which Service Portal the user is accessing.  You can do this by looking at the URL and finding the suffix given after the .com.  For example, demonightlykingston.service-now.com/sp?id=sc_home is using the 'sp' Service Portal.
2.  Go to the sp_portal list.  Search "URL Suffix".
3.  Open the record.  There's a reference field called 'Theme'.  Open that record, which takes you to sp_theme record.
4.  Check the 'Header' reference field.  Out-of-box, you'll see 'Stock Header'.  But the customer may have modified it.
 
To determine if the Header Widget is using the expected Angular Template:
 
1.  Open up the Header Widget.  Scroll down to the bottom of the page.
2.  Check the 'Angular ng-templates' related list.  For the Stock Header widget, there should be a record called 'modalLogin'.
 
If the record is missing:
 
Go to the sp_ng_template list and search for 'modalLogin'.  If you find the record, open it up and check the 'Widget' reference field.
 
Angular Templates are not many-to-many, so there must exist one record per widget.  If the customer clones the 'Stock Header' widget, they will also have to either:
 
- Create a new Angular ng-template, with a new name.  Because the widget calls 'modalLogin' by name, a line in the Client controller must also be changed.  The function is here:
 
$scope.openLogin = function () {
$scope.modalInstance = $uibModal.open({
templateUrl: 'modalLogin',
scope: $scope
});
 
If the 'modalLogin' sp_ng_template record does not exist, you can import it from out-of-box.  Edit the 'Widget' reference field to reference the Header Widget being used when the user clicks 'Login'.
 
--
 
The issue specifically is that the widget tries to open a modal window called 'modalLogin'.  The widget is expected to have the angular template.  If that angular template does not exist, then the widget tries to navigate to 'modalLogin' via URL -- which attaches itself to the relay state.  When the user is authenticated, the relay state brings them to 'modalLogin'.

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.