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

If your portal is public, they don't have to login to access it. If you want to ensure they login when you access something like



https://YOURINSTANCE.service-now.com/sp



make sure the service portal "sp" is NOT public and they will be forced to login. You've just ensured by the time they get to the Service Potral, they are logged in.



Is that what you were looking for?


Yes this it. however, i dont want the user to have to login with credentials. is there a way to connect the portal login with SSO?


That depends on how you have SSO configured on the instance. If you are not logged in, it can redirect to your IDP, get credentials (or use the network credentials already provided) then continue on to the portal. This works well for us internally (at a corporate office), but when I'm remote, I still need to manually login to the IDP before going to the portal.



Unfortunately, I don't know the details of SSO and Service Portal to provide an exact solution, but I do know it can be done.


Bummer. Thank you for your help thus far. Do you think this is worthy of a HI ticket?


You can certainly reach out to customer support via HI. I'll be curious to hear what they have to say.