- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2015 11:40 AM
A Login Rule was created to redirect users without roles to our ESS portal, but it's not working, possibly due to SAML/SSO. I also tried a UI Script and tested it in dev, which worked fine. To confirm, the Login Rule and UI Script worked great in dev, but not in prod.
The difference between dev and prod is the login method. Our prod environment uses SAML/SSO but we do not use SAML/SSO in dev and rely on local passwords.
My guess is that there's a redirection issue, but I'm not sure where to start. Hoping the Community can shed some light on the situation.
Thank you in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2015 09:43 AM
Hi Alexander,
In your script, if the URL does not contain the lowercase string "ess" the page will constantly change to "https://company.service-now.com/CompanyESS/main.do". Since that doesn't contain the lowercase string "ess" it will reload endlessly.
If you want to use that method, pass the current document URL through toLowerCase:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
Which would look more like : if (document.URL.toLowerCase().indexOf('ess')==-1)
That will solve the endless refresh. however, I still believe that modifying your Installation Exit is a better strategy, since you don't have to load an incorrect page first, and you aren't shipping this Javascript to every single page even if it's not needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2015 02:14 PM
Hi Alexander,
You need to update the active Installation Exit for SAML2SingleSignOn. See this thread for more insformation:
Redirecting user logins - UI Scripts, Login Rules, or Installation Exits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2015 04:58 AM
Hey Cory, I was able to get a UI Script working, but the page refreshes constantly. It also seems to send the user back to the ESS homepage every time I attempt to click on a link. And for whatever reason, two of the links under my Knowledge category continuously change their order with each other in the list of links. Does anyone know why this occurs?
addLoadEvent(ESSUserRedirect);
function ESSUserRedirect() {
if (!g_user.hasRoles()) {
if(document.URL.indexOf('ess')==-1)
{
window.location = "https://company.service-now.com/CompanyESS/main.do";
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2015 09:43 AM
Hi Alexander,
In your script, if the URL does not contain the lowercase string "ess" the page will constantly change to "https://company.service-now.com/CompanyESS/main.do". Since that doesn't contain the lowercase string "ess" it will reload endlessly.
If you want to use that method, pass the current document URL through toLowerCase:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toLowerCase
Which would look more like : if (document.URL.toLowerCase().indexOf('ess')==-1)
That will solve the endless refresh. however, I still believe that modifying your Installation Exit is a better strategy, since you don't have to load an incorrect page first, and you aren't shipping this Javascript to every single page even if it's not needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-05-2015 10:04 AM
As always, thank you for the quick response Cory. You were right, I thought I had the toLowerCase() in there already. Evidently not.
This works as intended, but one issue I'm noticing is that users are redirected to the ESS portal upon clicking URI_REF links in their notifications. What is the common practice to make the URI_REF links useful again?