Forum Discussion
Member_9894
May 10, 2010Nimbostratus
Login Banner
Hello.I've been tasked to create a login banner that will pop up when an external user hits my LTM and goes to any of my virtual servers. It's supposed to consist of a short message explaining that u...
hooleylist
Jun 28, 2010Cirrostratus
It should be relatively simple to implement a Javascript injection in responses. I think the trick is to figure out what code you want to inject and under which circumstances. For example, if this was the HTML for your index page:
My test index page
This is the rest of the HTML in the body...
You could use a stream profile and STREAM::expression based iRule to replace < body > with < body > < script >alert('Click ok to access the page')< /script >:
My test index page
This is the rest of the HTML in the body...
If you wanted to serve a page instead of Javascript, you could use logic like has been done in the maintenance page Codeshare examples. On any request (or any request to a login page), check for a cookie which the iRule sets upon clicking okay in a form. If the cookie is not set, redirect the client to /tos.html or some other page which is served from the iRule. On requests to that page, you send back the HTML for a banner page with an Accept button. The form action could be the same URI with a query string parameter set like /tos.html?accept=1. On requests to /tos.html?accept=1, you could redirect to the login page or the originally requested page and set a cookie indicating acceptable of the terms of service.
Here are links to the maintenance page examples:
http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePageGenerator.html
http://devcentral.f5.com/wiki/default.aspx/iRules/LTMMaintenancePage.html
http://devcentral.f5.com/wiki/default.aspx/iRules/Automatic_maintenance_page___Sorry_page_with_images.html
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects