Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Prevent Auto Redirect to IDP for External Users on ServiceNow Portal

Puneet Hegde1
Tera Guru

Hi Community,

We’re facing an issue with our ServiceNow external portal where the Auto Redirect to IDP is triggering for external users as well, which is not the desired behaviour.

Here’s our setup:

  • Internal users are connected via Active Directory (AD) and should be redirected to the IDP automatically.
  • External users log in using username and password and should not be redirected to the IDP.

Currently, when anyone visits the external portal, the auto-redirect kicks in regardless of whether they are internal or external. We want to ensure that:

  • Auto-redirect to IDP only applies to internal users
  • External users can access the login page without being redirected

Has anyone implemented a solution or workaround for this? Is there a way to conditionally disable auto-redirect based on user type?

Any guidance or best practices would be greatly appreciated!

Thanks,
Puneet

1 ACCEPTED SOLUTION
9 REPLIES 9

@Ankur Bawiskar ,
When users access the portal (csm), it opens the csm_landing page, which is the same as the front-end page but with some information restricted because the user is not logged in. When the user clicks on the login option, a widget normally appears for entering login credentials. In my case, it works as expected if auto-redirection is off. If auto-redirection is on, then that login option directly triggers the IDP to initiate.

Thank you,
Puneet

@Puneet Hegde1 

My thoughts

1) when you enable "Auto redirect IdP" all unauthenticated users will be taken to SSO including snc_external, snc_internal

2) till this point, ServiceNow doesn't know if it's External/Internal user

3) you can update SPEntryPage script include to check for the snc_external role and redirect accordingly, you can add condition and redirect them to portal page

If my response helped please mark it correct and close the thread so that it benefits future readers.

@Ankur Bawiskar ,

The SPEntryPage is triggered after the user is authenticated. My current challenge is preventing redirection to the Identity Provider (IDP) for a specific portal—for example, the CSM portal.

Ideally, even if an employee accesses the CSM portal and attempts to log in, they should be presented with login options rather than being automatically redirected to the IDP.


Thank you,
Puneet

@Puneet Hegde1 

you might have to do some customizations.

Check below response