Forum Discussion
Applying APM on an iframe
- Dec 13, 2022
So we did some more testing, and this is not going to work.
We've worked with support and experimented with iRules to insert additional headers and cookies into the response, but the behaviour of CORS is that these are always going to be removed. And because APM relies heavily on cookies to function, it does mean that accessing APM-protected content from an iFrame will fail to work.
Hello CA_Valli ,
Thank you for sharing all this information it very helpfull.
Do you mind to share how did you achieve this (Irule, specific config ...)?
Thank you very much
iRule kinda looks like this.
I suggest you to raise a support case if you need specific tuning.
when HTTP_REQUEST {
if { $host eq "apmprotected.mybusiness.com" && [HTTP::header exists "Referer"]}{
set referer_host [string tolower [URI::host [HTTP::header "Referer"]]]
if { $referer_host ne "partnerportal.company.com" && $referer_host ne "apmprotected.mybusiness.com"}{
# iframes in unauthorized portals get redirected to main auth
# notice I had to include my own portal as "authorized" to correctly load scripts,css,etc.
HTTP::respond 302 Location "https://apmprotected.mybusiness.com/"
} else {
# i have a big list of IFs here to match specific conditions
ACCESS::disable
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com