Help
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Redirect user to Service Portal?

Tom Sienkiewicz
Kilo Sage

Hi, I am struggling a bit with a problem that someone hopefully can help resolve...

I have users with no roles (ess users) logging in to the Service Portal, but I want to restrict their acess only to SP sites.

Meaning that if someone deletes/changes the url, e.g.

instance.service-now.com/sp

to

instance.service-now.com

or

instance.service-now.com/sys_user_list.do

They should see a blank page,or ideally end up back on service portal homepage.

Right now, they can see the application and some of the tables/pages - and those cannot be restricted using ACL.

I tried a global ui script,but this only redirects AFTER the whole page has loaded, which is really bad.

Do you know any way how such thing might be prevented?

Thanks!

7 REPLIES 7

SanjivMeher
Kilo Patron
Kilo Patron

Hi Tomasz,



Try using login rules.


For ex, below if a user doesnt have any role, we are redirecting them to our self service portal.



find_real_file.png



Please mark this response as correct or helpful if it assisted you with your question.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Tomasz,



Check in sys_properties for this property name:


glide.entry.page.script


This determines where user needs to redirect on logging in if has no roles.



In the sys_properties table, add the following property:



PropertyTypeValueDescription
glide.entry.first.page.scriptstringnew SPEntryPage().getFirstPageURL()First page after authentication

getFirstPageURL primarily does the following:


  • Redirects to login_redirect.do in order to break out of the frameset (if there is one).
  • Redirects to Service Portal if the user has no roles, or the full platform for everyone else.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards
Ankur

Thanks, will give it a try tomorrow and will let you know how it went!


Hi Ankur,



I checked the proposed solution, however this would only work if the user is not yet logged in. If they are logged in to the portal, then they change the url or open a new one, it will not detect this.



I would need a solution which will basically run everytime someone accesses an instance URL - global UI script seems to be the only solution but still it runs only after the page is rendered. If there was anyway to access the script running BEFORE page content is loaded, that would be perfect...