jason_petty
Tera Expert

There is an article found on John Andersen's Blog here:

http://www.john-james-andersen.com/blog/service-now/fixing-saml-2-0-frame-in-frame-timeout-issues-in-servicenow.html

This blog demonstrates the way to fix the Frame-in-Frame problem with the SAML 2.0 plugin but the SAML 2.0 Update 1 plugin has changed the location of the code that is mentioned to change in the Login Script. This code is now in the Script Include. These are the steps you can take to fix this issue with the new plugin:

1. You still want to create the frame_bust.do UI page with this code:



<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<g:evaluate var="jvar_service_url">
var prop = new GlideRecord("sys_properties");
prop.addQuery("name", "glide.authenticate.sso.saml2.service_url");
prop.query();
prop.next();
prop.value;
</g:evaluate>

<script>
if("${jvar_service_url}"){
top.location.replace("${jvar_service_url}");
}
</script>

</j:jelly>


2. Modify the "SAML2_update1" Script Include. Find the following code:


if (!requestURI ||requestURI.equals("") || requestURI.equals("/")) {
// No deep linking
this.logDebug("No Deep Linking for this SAML request");
relayState = this.serviceUrl;
} else if (this.needNavFrame(request)) {
this.logDebug("There may be Deep Linking involved with this SAML request");
//use saml_redirector to make sure we bust out of the current frame before loading another NavFrame.
relayState = baseUrl + "/saml_redirector.do?sysparm_uri=/nav_to.do?uri=" + requestURI;
} else {
relayState = baseUrl + requestURI;
}


Modify the above code to this (Just added a few lines of code at the top):


if(!requestURI ||requestURI.equals("") || requestURI.equals("/")){
requestURI = "frame_bust.do";
}
if (!requestURI ||requestURI.equals("") || requestURI.equals("/")) {
// No deep linking
this.logDebug("No Deep Linking for this SAML request");
relayState = this.serviceUrl;
} else if (this.needNavFrame(request)) {
this.logDebug("There may be Deep Linking involved with this SAML request");
//use saml_redirector to make sure we bust out of the current frame before loading another NavFrame.
relayState = baseUrl + "/saml_redirector.do?sysparm_uri=/nav_to.do?uri=" + requestURI;
} else {
relayState = baseUrl + requestURI;
}

2 Comments