<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to Redirect Admins to a UI Page During Login for Validation? in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/how-to-redirect-admins-to-a-ui-page-during-login-for-validation/m-p/3314010#M3656</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to implement a &lt;STRONG&gt;custom login flow&lt;/STRONG&gt; in our ServiceNow instance that introduces an additional validation step &lt;STRONG&gt;only for users with the admin role&lt;/STRONG&gt;. The goal is to ensure that administrators provide a valid reason and reference a specific record before they are granted access to the platform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Detailed Requirement:&lt;/P&gt;&lt;P&gt;When a user attempts to log in using the standard login.do&amp;nbsp; in ServiceNow:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Check User Role:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;If the user does &lt;STRONG&gt;not&lt;/STRONG&gt; have the admin role and tries to log in using login.do → Don't allow the user to log in instead, re-direct to the default login page(SSO).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If the user &lt;STRONG&gt;has&lt;/STRONG&gt; the admin role&amp;nbsp;and tries to log in using login.do → &lt;STRONG&gt;intercept&lt;/STRONG&gt; the login and redirect the user to a custom &lt;STRONG&gt;UI Page&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Custom UI Page Behavior:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The UI Page should prompt the admin user to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Enter a valid record number&lt;/STRONG&gt; (of type INC, CHG, or RITM).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Provide a reason for login&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;On form submission, the backend should:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Validate the provided record number by checking its existence in the corresponding table (incident, change_request, or sc_req_item).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure the &lt;STRONG&gt;login reason is not empty&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Decision Logic:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;If the record number is valid and a reason is provided → allow the user to continue to the home page (home.do) or record page(INC page).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If the record number is &lt;STRONG&gt;invalid&lt;/STRONG&gt; or the reason is &lt;STRONG&gt;missing/empty&lt;/STRONG&gt; → immediately log the user out (logout.do).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Audit (store the login information like record number and reason):&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Store the admin’s login reason and the referenced record number for auditing purposes.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;What is working.&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Once the user enters their credentials and clicks on login, it redirects the user to the custom UI page by checking the role.&lt;/LI&gt;&lt;LI&gt;On the UI page user can enter the record number, and the reason is entered. Even though the record is valid, &lt;STRONG&gt;we are unable to re-direct to the home page.&amp;nbsp;&lt;/STRONG&gt;It stays on the same(Custom UI page) with the values cleared.&lt;/LI&gt;&lt;LI&gt;When I change the URL, the session is already logged in. It is supposed to redirect us to the home page automatically.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Login Page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="login page.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/454215i7EC501E1A22FD83F/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="login page.png" alt="login page.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Custom UI page&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UI Page.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/454217i17BD49F458F6D559/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="UI Page.png" alt="UI Page.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;Here is the Script I have used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Jul 2025 12:26:55 GMT</pubDate>
    <dc:creator>manikantara</dc:creator>
    <dc:date>2025-07-08T12:26:55Z</dc:date>
    <item>
      <title>How to Redirect Admins to a UI Page During Login for Validation?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-redirect-admins-to-a-ui-page-during-login-for-validation/m-p/3314010#M3656</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to implement a &lt;STRONG&gt;custom login flow&lt;/STRONG&gt; in our ServiceNow instance that introduces an additional validation step &lt;STRONG&gt;only for users with the admin role&lt;/STRONG&gt;. The goal is to ensure that administrators provide a valid reason and reference a specific record before they are granted access to the platform.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Detailed Requirement:&lt;/P&gt;&lt;P&gt;When a user attempts to log in using the standard login.do&amp;nbsp; in ServiceNow:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Check User Role:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;If the user does &lt;STRONG&gt;not&lt;/STRONG&gt; have the admin role and tries to log in using login.do → Don't allow the user to log in instead, re-direct to the default login page(SSO).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If the user &lt;STRONG&gt;has&lt;/STRONG&gt; the admin role&amp;nbsp;and tries to log in using login.do → &lt;STRONG&gt;intercept&lt;/STRONG&gt; the login and redirect the user to a custom &lt;STRONG&gt;UI Page&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Custom UI Page Behavior:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;The UI Page should prompt the admin user to:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Enter a valid record number&lt;/STRONG&gt; (of type INC, CHG, or RITM).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Provide a reason for login&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;On form submission, the backend should:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Validate the provided record number by checking its existence in the corresponding table (incident, change_request, or sc_req_item).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Ensure the &lt;STRONG&gt;login reason is not empty&lt;/STRONG&gt;.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Decision Logic:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;If the record number is valid and a reason is provided → allow the user to continue to the home page (home.do) or record page(INC page).&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;If the record number is &lt;STRONG&gt;invalid&lt;/STRONG&gt; or the reason is &lt;STRONG&gt;missing/empty&lt;/STRONG&gt; → immediately log the user out (logout.do).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Audit (store the login information like record number and reason):&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;P&gt;Store the admin’s login reason and the referenced record number for auditing purposes.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;What is working.&lt;BR /&gt;&lt;UL&gt;&lt;LI&gt;Once the user enters their credentials and clicks on login, it redirects the user to the custom UI page by checking the role.&lt;/LI&gt;&lt;LI&gt;On the UI page user can enter the record number, and the reason is entered. Even though the record is valid, &lt;STRONG&gt;we are unable to re-direct to the home page.&amp;nbsp;&lt;/STRONG&gt;It stays on the same(Custom UI page) with the values cleared.&lt;/LI&gt;&lt;LI&gt;When I change the URL, the session is already logged in. It is supposed to redirect us to the home page automatically.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Login Page&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="login page.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/454215i7EC501E1A22FD83F/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="login page.png" alt="login page.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Custom UI page&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="UI Page.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/454217i17BD49F458F6D559/image-size/medium/is-moderation-mode/true?v=v2&amp;amp;px=400" role="button" title="UI Page.png" alt="UI Page.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;BR /&gt;Here is the Script I have used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 12:26:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-redirect-admins-to-a-ui-page-during-login-for-validation/m-p/3314010#M3656</guid>
      <dc:creator>manikantara</dc:creator>
      <dc:date>2025-07-08T12:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to Redirect Admins to a UI Page During Login for Validation?</title>
      <link>https://www.servicenow.com/community/community-central-forum/how-to-redirect-admins-to-a-ui-page-during-login-for-validation/m-p/3314024#M3657</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/473752"&gt;@manikantara&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;this seems to be an extra burden when it comes to maintenance.&lt;/P&gt;
&lt;P&gt;so what debugging did you perform?&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jul 2025 12:33:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/how-to-redirect-admins-to-a-ui-page-during-login-for-validation/m-p/3314024#M3657</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-07-08T12:33:49Z</dc:date>
    </item>
  </channel>
</rss>

