78 views

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'.

Article Information

Last Updated:2018-06-07 12:15:22
Published:2018-06-07