Welcome page (login) redirection to SP login page

John241
Tera Expert

Hi ! 

I need your help. When i'm connecting to my instance https://dev48627.service-now.com/ for loggin I want to be redirect automatically to this logging page = https://dev48627.service-now.com/sp/?id=landing 

How could I do that please?

Thanks

1 ACCEPTED SOLUTION

Ahh! Sorry, I misunderstood.

In that case change the system property: glide.entry.page.script

The value is probably: new CMSEntryPage().getEntryPage()

Change it to: new SPEntryPage().getLoginURL()

 

That should do it! Please mark my answer as correct if so.

Thanks,

Josh

View solution in original post

6 REPLIES 6

Hello Josh,

 

when i am trying to login to portal via the portal login page(<instancename>.servicenow.com/xyz ) it is taking me to the homepage and i have configured the below system property "glide.entry.first.page.script" and added the value of our custom SPEntrypage script include "new CustomSPEntryPage().getFirstPageURL();" when role based users try to login to instance it will redirect them to navpage.do and for end users it will redirect them to portal.

But when our users directly try to login via the portal page, it is redirecting them to navpage.do(homepage), Please help me to fix this issue.

else if (session.getCurrentDomainID() == "our domain sysid") { // we work in domain seperated instance


gs.log("Current Domain IS Elis", "Portal Redirection Logs");

this.portal = "/xyz/";
// has roles and is not a Service Portal page - go to UI16
var session = gs.getSession();
this.logProperties('before', session);

// has roles and is not a Service Portal page - go to UI16
var nt = session.getProperty("nav_to");
var isServicePortalURL = new GlideSPScriptable().isServicePortalURL(nt);
var redirectURL = session.getProperty("login_redirect"); // it is returning null

gs.log('nt:' + nt, "nt"); //null from portal page
gs.log('isServicePortalURL:' + isServicePortalURL, "isServicePortalURL"); 
gs.log('redirectURL:' + redirectURL, "redirectURL"); 
gs.log('not redirectURL:' + !redirectURL, "not"); //true

 

if (user.hasRoles() && !redirectURL && !isServicePortalURL)
return;

// user may have logged in from a frame, the /login_redirect.do page will bust out of it
if (!redirectURL) {
// redirectURL is nav_to
// if nav_to == "welcome.do" then use starting_page
gs.log('entering inside first if:');
var sPage = session.getProperty("starting_page");
gs.log('sPage:' + sPage, "sPage"); //null
if (sPage && nt == "welcome.do")
nt = sPage;
gs.log('nt1:' + nt, "nt&spage"); //home.do

// Avoid a redirect loop to the home page
var ep = gs.getProperty("glide.login.home");
gs.log('ep:' + ep, "ep"); //home.do
if (nt) {
gs.log('entering inside 3rd if:');
if (ep == nt)
nt = null;
}
gs.log('nt:'+nt,"after setting it to null");
// PRB726860: if page is still welcome.do, go to glide.login.home preserving frameset
if (nt == "welcome.do") {
session.putProperty("nav_to", ep);
return;
}

session.putProperty("login_redirect", nt || "true");
return "/login_redirect.do?sysparm_stack=no";
}

session.clearProperty("login_redirect");
var returnUrl = this.portal;
if (redirectURL && redirectURL != "true") {
var spUrl = new GlideSPScriptable().mapUrlToSPUrl(redirectURL);
returnUrl = spUrl ? this.portal + "?" + spUrl : redirectURL;
}

this.logProperties('after', session);
if (!this.logVariables) {
gs.log('redirectURL: ' + redirectURL);
gs.log('User: ' + user.getName());
gs.log('is internal: ' + (!user.hasRoles()));
gs.log('returnUrl: ' + returnUrl);
}
gs.log('returnUrl:' + returnUrl, "returnurl");
return returnUrl;

}

Ajaykumar1
Tera Guru

Hi John,

In the following thread, Brandon has explained different ways regarding Service portal redirection, please go through it.

6 ways to set up your Service Portal for redirection SUCCESS!

 

Mark If Correct/Helpful.

Regards,
Ajay