<?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 Re: Redirecting Users to Login Page After Account Lockout in ServiceNow in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3118594#M531954</link>
    <description>&lt;P&gt;I was able to achived the required work with the simple by logging out the user using &lt;STRONG&gt;'&lt;SPAN&gt;gs.setRedirect(&lt;/SPAN&gt;&lt;SPAN&gt;'/logout.do'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;'&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;it help me to auto redirect to login page based on the portal users are using.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2024 14:36:17 GMT</pubDate>
    <dc:creator>Puneet Hegde1</dc:creator>
    <dc:date>2024-12-03T14:36:17Z</dc:date>
    <item>
      <title>Redirecting Users to Login Page After Account Lockout in ServiceNow</title>
      <link>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3117842#M531895</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I am trying to redirect users to the login page (&lt;/SPAN&gt;/login.do&lt;SPAN&gt;) when their account gets locked due to too many failed login attempts. I've implemented the following script in a Business Rule that triggers after a failed login:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;if (gr.failed_attempts &amp;gt; 4) {&lt;BR /&gt;gr.locked_out = true;&lt;BR /&gt;gr.update();&lt;BR /&gt;gs.log("User " + gr.user_name + " locked out due to too many invalid login attempts");&lt;BR /&gt;gs.addErrorMessage("Your account has been locked due to too many failed login attempts. Please contact the support team at XXXXXXXXX@XXX.com");&lt;BR /&gt;&lt;BR /&gt;// Redirect users to the login page&lt;BR /&gt;var response = gs.getSession().getResponse();&lt;BR /&gt;response.setStatus(303); // HTTP status for redirection&lt;BR /&gt;response.sendRedirect("/login.do"); // Redirect to login page&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, the redirection doesn't seem to work, and users are not being redirected to the login page as expected. Instead, the error message is displayed, and the page stays on the current view.&lt;/P&gt;&lt;H3&gt;What I've Tried:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;Verified that /login.do is the correct URL.&lt;/LI&gt;&lt;LI&gt;Used gs.addErrorMessage to notify users of the lockout.&lt;/LI&gt;&lt;LI&gt;Cleared cache (/cache.do) and tested the changes again.&lt;/LI&gt;&lt;LI&gt;Experimented with both g_response and gs.getSession().getResponse() for redirection.&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;Environment:&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;Running in a Scripted Event triggered on login failure.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 20:05:22 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3117842#M531895</guid>
      <dc:creator>Puneet Hegde1</dc:creator>
      <dc:date>2024-12-02T20:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Redirecting Users to Login Page After Account Lockout in ServiceNow</title>
      <link>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3118329#M531920</link>
      <description>&lt;P&gt;Take a look at Script Include &lt;STRONG&gt;SPEntryPage&lt;/STRONG&gt; which controls redirects etc.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 10:31:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3118329#M531920</guid>
      <dc:creator>Paul Curwen</dc:creator>
      <dc:date>2024-12-03T10:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Redirecting Users to Login Page After Account Lockout in ServiceNow</title>
      <link>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3118594#M531954</link>
      <description>&lt;P&gt;I was able to achived the required work with the simple by logging out the user using &lt;STRONG&gt;'&lt;SPAN&gt;gs.setRedirect(&lt;/SPAN&gt;&lt;SPAN&gt;'/logout.do'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;STRONG&gt;'&lt;BR /&gt;&lt;/STRONG&gt;&lt;SPAN&gt;it help me to auto redirect to login page based on the portal users are using.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2024 14:36:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/redirecting-users-to-login-page-after-account-lockout-in/m-p/3118594#M531954</guid>
      <dc:creator>Puneet Hegde1</dc:creator>
      <dc:date>2024-12-03T14:36:17Z</dc:date>
    </item>
  </channel>
</rss>

