Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

SSO Redirection to SSO Login Page

Rairai31
Giga Guru

Hi All,

We have 2 buttons in the login page for the SSO. I have created a system property with the value of the sys_id of the IdP. When the button (Login1/MS Login) is clicked it goes to a logout/timeout.do then goes back to the login page. Is there any code I am lacking? So after the logging in to the SSO, it will redirect you to the portal (/customer_portal). Thank you very much. 

HTML Template: 

Rairai31_1-1698211892227.png

Server Script:

Rairai31_0-1698212551668.png

System property:

Rairai31_3-1698212100486.pngRairai31_4-1698212241596.png

 

 

2 REPLIES 2

Peter Bodelier
Giga Sage

Hi @Rairai31,

 

Take a look at the OOTB login widget (https://instance.service-now.com/nav_to.do?uri=sp_widget.do?sys_id=6506d341cb33020000f8d856634c9cdc)

 

The navigation is handled within the client script, not within the HTML part.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Samaksh Wani
Giga Sage

Hello @Rairai31 

 

  1. Ensure the System Property glide.entry.first.page.script to new SPEntryPage().getFirstPageURL().
  2. Modify line Script Include SPEntryPage around line 69 to add something like follows:
// Redirect all users to a custom page, unless SP or redirect
if (!redirectURL && !isServicePortalURL)
   return 'your_custom_page.do';

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh