Interested in a ServiceNow event built for developers? Registration for now[dev]26 is officially open!

How can we modify the login page for Now Mobile to use our custom instance login page.

Fury12345
Tera Contributor

We have customized the login page for our ServiceNow instance using the SPEntryPage script include, and it works fine for web/browser logins. However, this change does not apply to the Now Mobile application — no matter what we do, the mobile app always redirects to oauth_login.do instead of our custom login page. We want Now Mobile to use the same custom login page that we use for our instance. We checked the Login URL field on the Application Registry used by Now Mobile, but it's currently empty and we're not sure how to properly point it to our custom login page, or whether that's even possible for the mobile app's login flow. Has anyone run into this and found a way to get Now Mobile to load a custom login page instead of oauth_login.do? Any guidance would be appreciated.

2 REPLIES 2

Shahjay
Kilo Guru

Hi @Fury12345,

SPEntryPage / glide.entry.page.script won't help you here — that only controls where a browser session lands after login, it has nothing to do with the mobile apps. Now Mobile and Agent Mobile authenticate as OAuth clients, so the page they open is whatever's sitting in the Login URL field on the matching Application Registry record. Since yours is empty, it's just falling back to oauth_login.do, which is exactly what you're seeing.

So the fix is to go into Application Registry, open the OAuth entry the app is actually using (ServiceNow Agent, or ServiceNow Request/Now Mobile depending on which app you're testing), and put the relative path of your custom login page in the Login URL field — the same page SPEntryPage is already sending browser sessions to. Save it, then fully log out of the app on your phone or just delete and reinstall it, because it'll hang onto the old session and you'll swear nothing changed when it actually did.

One thing to watch for: your page works fine for browser because that's a normal web session, but the native app still needs a completed OAuth token exchange at the end of the flow. If that page was built purely for Service Portal/browser use, double check it actually redirects back with a valid token instead of just showing a form — that's usually where this trips people up, the page loads fine but the app never gets handed anything to authenticate with.

A couple of things that get suggested for this kind of issue but don't actually apply to you: setting Login URL to oauth_login.do is the known fix when Force Local Login isn't being respected and the Agent app keeps falling through to SSO — different problem, not yours, since you want a custom page not the stock one. Same with login_with_sso.do?glide_sso_id=..., that's for forcing a specific IdP. There's also a separate Force Local Login toggle per app under Mobile App Configs if you ever need local login to win over SSO, and it's worth knowing glide.authenticate.external = true is a known way to break Now/Agent Mobile login entirely (there's a support KB on it, KB0821516), so if things still don't work after your change that's worth ruling out before you go further down the Login URL path. And if this were about branding rather than auth flow there's a preLoginLandingPage mobile property for showing something before the credential screen, but that's a different feature, not what you're after.

Test this on a sub-prod instance first if you can, and it's worth having one OAuth client per app rather than sharing a registry record — makes it a lot easier to tell what's actually happening when you're testing local login, SSO, and your custom page separately.


If this helped, please mark it Helpful / Accept as Solution.


Thanks 

If this response helped, please mark it as correct and close the thread ✅ — it helps future readers find the solution faster.

Thanks

Hi @Shahjay ,

I tried the approach you mentioned above, but after updating the Login URL, the mobile login screen is now automatically redirecting to the browser login screen instead of executing the script mentioned on the custom UI page that I have created.

I also tried directly accessing the UI page that I created in the browser, but it gets redirected to our instance login page. However, this behavior is different with oauth_login.do, as when I access it, it stays on the same page and does not redirect.

Is there anything I might be missing or any additional configuration that needs to be done?

Thanks!