Redirect ESS users to different login page

sukran
Mega Sage

ESS users redirect to sp page based on the following property ( glide.entry.loggedin.page_ess) ,

In exception case if ESS users belong to  plant  department then should redirect to nav.do page

 

can we set value of property based on script ?

 

sukran_0-1674983536859.png

 

1 ACCEPTED SOLUTION

Paul Curwen
Giga Sage

Yes you can, you can modify the Script Include that is provided OOTB named SPEntryPage

 

That Script Include that is controlled by a pair of System Properties to automatically route users to the  service portal (/sp). To set this up you  need to add a property to the sys_properties (table) and by default all users that do not have a role will be automatically pushed to the  service portal.

 

To create the new property follow these steps:

  1. type “sys_properties.list” in the filter navigator and press enter
  2. check to see if the “glide.entry.first.page.script” property already exists (if it doesn’t click NEW at the top of the list view)
    1. Name: “glide.entry.first.page.script
    2. Value: “new SPEntryPage().getFirstPageURL()
    3. Click SAVE

This Support page article takes you through the basics: 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746730

 

You will also find these useful: 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0747432

 

Here is an example of changing it to redirect users without a certain role: 

 

You want to redirect all users who do not have a specific role to the service portal. This can be accomplished by implementing the above mentioned System Property and altering a baseline Script Include called “SPEntryPage“.

 

To automatically redirect users to the service portal if they do not have a particular role:

  • Go to System Definition/Script Include module and search for the script include called “SPEntryPage“.
  • Alter line #69 (it looks like this) by altering the script to include a role such as “itil” it will redirect all users that do not have the “itil” role (or the admin role because admin is included by default) directly to the service portal. Your altered script should look like this:

code.PNG

 

 

If helpful please mark as Helpful/Correct

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

View solution in original post

3 REPLIES 3

Paul Curwen
Giga Sage

Yes you can, you can modify the Script Include that is provided OOTB named SPEntryPage

 

That Script Include that is controlled by a pair of System Properties to automatically route users to the  service portal (/sp). To set this up you  need to add a property to the sys_properties (table) and by default all users that do not have a role will be automatically pushed to the  service portal.

 

To create the new property follow these steps:

  1. type “sys_properties.list” in the filter navigator and press enter
  2. check to see if the “glide.entry.first.page.script” property already exists (if it doesn’t click NEW at the top of the list view)
    1. Name: “glide.entry.first.page.script
    2. Value: “new SPEntryPage().getFirstPageURL()
    3. Click SAVE

This Support page article takes you through the basics: 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0746730

 

You will also find these useful: 

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0747432

 

Here is an example of changing it to redirect users without a certain role: 

 

You want to redirect all users who do not have a specific role to the service portal. This can be accomplished by implementing the above mentioned System Property and altering a baseline Script Include called “SPEntryPage“.

 

To automatically redirect users to the service portal if they do not have a particular role:

  • Go to System Definition/Script Include module and search for the script include called “SPEntryPage“.
  • Alter line #69 (it looks like this) by altering the script to include a role such as “itil” it will redirect all users that do not have the “itil” role (or the admin role because admin is included by default) directly to the service portal. Your altered script should look like this:

code.PNG

 

 

If helpful please mark as Helpful/Correct

***If Correct/Helpful please take time mark as Correct/Helpful. It is much appreciated.***

Regards

Paul

sukran
Mega Sage

@Ankur Bawiskar Any Help would be helpfull

Ankur Bawiskar
Tera Patron
Tera Patron

@sukran 

Paul has already mentioned the approach.

you need to update the script include

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader