How do I guarantee a logged in session for a new service portal

Joey Wan Kenobi
Tera Guru

If i provide a link to the homepage a service portal i created, how can i guarantee that the user session actually begins?

I have server scripts that check for information about the user's session (gs.hasRole, gs.getUserID()), but they dont work if the session doesnt actually begin. The links to the page just bring the user to the page without logging them in.  

1 ACCEPTED SOLUTION

A HI ticket did the trick. I had to set the public page for $sp to false IN ADDITION to setting the public page for $my_new_service_portal to false (i had only performed the latter, not thinking that $sp would have any bearing on the other portal).



Now, any direct link to one of the pages on $my_new_service_portal will log the user in via SSO first (if they aren't already) and then route them to the requested page.



Thanks again for your help.


View solution in original post

11 REPLIES 11

A HI ticket did the trick. I had to set the public page for $sp to false IN ADDITION to setting the public page for $my_new_service_portal to false (i had only performed the latter, not thinking that $sp would have any bearing on the other portal).



Now, any direct link to one of the pages on $my_new_service_portal will log the user in via SSO first (if they aren't already) and then route them to the requested page.



Thanks again for your help.


jesseadams
ServiceNow Employee
ServiceNow Employee

Make sure the your portal is not public.


There's a table called sys_public that manages public pages - these don't require authentication to see.


If your portal URL is NOT listed there or is with active set to false login should be required before a user can view the page.


Then, they should be directed to either the instance login page or the portal login page depending on your configuration if they do not have a logged in session.