How to keep an account logged into Service portal

Supriya B
Tera Contributor

Hi All,

 

Please let me know how to keep an account logged in all the time in Service portal.

 

 

Thanks,

Supriya.

2 REPLIES 2

piyushsain
Tera Guru
Tera Guru

Hi,

You cant keep an account logged in all the time, but you can extend it to any time limit in the property glide.ui.session_timeout, maybe make it 24 hours or 48 hours

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

Anand Kumar P
Giga Patron
Giga Patron

Hi @Supriya B ,

If you want always user with specific role want to navigate to portal update SPEntryPage script include-

  1. Create or update the system property glide.entry.first.page.script. In some instances, this may already exist, but in many, it will need to be created as a String type property. Make sure to set the value to new SPEntryPage().getFirstPageURL() in order to invoke the SPEntryPage script.
    • In the base system, this is set to check if the user has any roles and is not trying to go to the Service Portal directly. If both pass, then it will send them to the value of the glide.login.home property or the page they were attempting to load prior to logging in. If the user does not have any roles, it will send them to the equivalent of that page in Service Portal

      For example:

      https://<instance_name>.service-now.com/nav_to.do?uri=change_request_list.do

      will send non-role users to

      https://<instance_name>.service-now.com/sp/?id=list&table=change_request

  2. Configure the SPEntryPage script include to handle your specific needs: NOTE: This requires customization of the base system code. Hopefully, this guide will be helpful in that process however any configuration outside of what is described above is not supported.
    • Lines 69 and 70 of the SPEntryPage script are what determines whether or not to redirect a user. You'll see by default that if the user has roles, there is not an existing redirect URL (login_redirect) and the user is not attempting to go to the Service Portal, the script will return - meaning the user is not redirected. In order to tailor this functionality, this function needs to be modified - make sure to leave the second two checks in place or you could break existing functionality. The user.hasRoles check is really the only part that can be modified. For example if you want users with a specific role to go to the platform UI by default, you might change the condition to if(user.hasRole("my_cool_role") && !redirectURL && !isServicePortalURL) 
    • If you want to increase account logged in time change this system property value.
      AnandKumarP_0-1699002794284.png


      Please mark it as solution proposed and helpful if its serves your purpose.

      Thanks,
    • Anand