Redirect to a specific page while using login.do on URL

JC S_
Mega Guru

We need a way to show a specific page after a login.do URL. Currently we are only able to redirect to default service portal. For example the URL of the page is instance.service-now.com/pagex, how do we incorporate the login.do then redirect to that page?

Current (working but redirects to default service portal only)

instance.service-now.com/login.do?user_name=XXXX&user_password=XXXXX&sys_action=sysverb_login

12 REPLIES 12

 

JC hi

I realise this is an oldish post - did you get a solution for your redirect requirement?

Thanks in advance

Daniele B
Tera Contributor

Hi,

I do not know if you need anymore, but I have exatly what you needed .

 

instead of "login.do" you can use "nav_to?uri=targetpage"

 

If you are not authenticated, it will bring you to a "login page" and after, it will redirect you to targetpage.

 

I think that it is as you need

Prins Kumar Gup
Giga Guru

Hi JC,

modified the function SPEntryPage.getFirstPageURL() to allow users to access "navpage.do".

69. //if (user.hasRoles() && !redirectURL && !isServicePortalURL)for users with no roles
70. if (!redirectURL && !isServicePortalURL){
71. return;
72.
73. }

 

and in the portal header (client controller line 11)

$scope.openLogin = function () {

$scope.modalInstance = $uibModal.open({

templateUrl: 'nav_to.do?uri=' + encodeURIComponent(window.location.href.replace(window.location.protocol+'//'+window.location.host, '')), // added this line of code for when a user try to click on some page and after login it will redirect to that page

/templateUrl: 'modalLogin',           // OOB

Thanks,

PKG

I'm not sure how this will work. Can you explain how it will work? So what exact URL do we need to go through if ever?