Forum Discussion
APM sends local favicon.ico to client instead of fetching it from the backend
Hi Lucas_Thompson ,
This looks good but there's one problem:
We have an APM application which will be served after login and we need the favicon from this backend app after login.
This is exactly not working and we always get the default favicon of APM back to the client.
The backend apps are always changing since this vs with APM policy is doing SAML SSO.
So, any idea how to get the favicon.ico of the backend to the client?
Thank you.
In this case you'd like the favicon to be transmitted to the client ONLY once they are succesfully authenticated? Something like this should work (for LTM+APM mode), it says basically "If there is no session and the user is requesting favicon, then send a 404 instead of the APM favicon."
I'm not exactly sure if the best bet is a 404 or something different, but because you don't know in advance what backend host should get the favicon request, you're forced to send some static content or error.
Please also note that this irule uses the "ACCESS::restrict_irule_events disable" command which causes the HTTP_REQUEST event to fire upon each access, rather than the default behavior of only firing on the non-built-in APM HTTP requests (such as for webtop, logon pages, SAML URIs, etc). Make sure you don't have any other irules with HTTP_REQUEST events that might interfere with user logons.
when CLIENT_ACCEPTED {
ACCESS::restrict_irule_events disable
}
when HTTP_REQUEST {
if { [HTTP::cookie exists "MRHSession" ] && [ACCESS::session exists -state_allow] } {
# user seems to have a valid session, let them get the backend resource
return
} else {
if { [HTTP::uri] contains "favicon" } {
# remove the following log line after testing
log local0. "user has no session, sending 404 for favicon request"
HTTP::close
HTTP::respond 404
}
}
}
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