- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
yesterday - edited yesterday
When working with ServiceNow Mobile Apps, it's important to ensure a smooth user experience—even in cases of authentication failure. This article explains how to redirect users to a custom landing page when an external logout fails.
Objective
Redirect users to the landing page defined in the sys_sg_properties
table when an external logout fails due to authentication issues.
🛠️ Step-by-Step Implementation
1. Create a Public UI Page for Redirection
Go to System UI > UI Pages and create a new UI Page. In the HTML section, include the following script:
window.open('/mesp?id=portal_page_id', '_self');
Replace portal_page_id with the actual page ID configured in your landing page property.
2. Configure the Landing Page Property
Navigate to the sys_sg_properties
table and locate the property that defines the landing page. It should look something like this:
{"url":"https://instancename.service-now.com/mesp?id=portal_page_id", "loginLabelTranslationKey":"login_label_txt"}
Ensure the url
matches the destination used in your UI Page script.
3. Make the UI Page Public
To allow unauthenticated users to access the redirection page:
- Go to Public Pages (sys_public) table
- Add an entry for your new UI Page
- Set the
Page
field to the name of your UI Page - Ensure
Active
is checked
This step is crucial for mobile users who are not authenticated to be redirected appropriately.
4. Update the Identity Provider Configuration
In your Identity Provider (IdP) settings:
- Locate the field External logout redirect
- Replace its value with the UI Page name, ensuring it ends with
.do
, for example:
your_ui_page_name.do
This ensures that when logout fails externally, the user is redirected to your custom UI Page, which then forwards them to the defined page.
📱 Result
When an external logout fails, the mobile app will redirect the user to the public UI Page, which in turn sends them to the landing page defined in sys_sg_properties
. This ensures a consistent and user-friendly fallback experience.