How to keep an account logged into Service portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 12:52 AM
Hi All,
Please let me know how to keep an account logged in all the time in Service portal.
Thanks,
Supriya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 01:54 AM
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
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2023 02:16 AM
Hi @Supriya B ,
If you want always user with specific role want to navigate to portal update SPEntryPage script include-
- 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
- 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
- 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.
Thanks,
Please mark it as solution proposed and helpful if its serves your purpose. - Anand