Forum Discussion
drumik_61546
Dec 19, 2014Nimbostratus
needs to some help with IRule that will assign sso
I'm trying to figure out a cleaner way to redirect clients when they try to access web page directly without login first to the portal
Setup:
2 portal pages and 2 domains
2 internal applica...
Michael_Jenkins
Dec 19, 2014Cirrostratus
The way that I've done it in our environment is the check for a valid APM session on each request. If there's no valid session, then redirect the user.
when HTTP_REQUEST {
if { not ([ACCESS::policy result] equals "allow") } {
HTTP::respond 302 "http://something.org" "Connection" "Close"
}
}
You could also perform a cookie check for MRHSession and LastMRH_Session cookies, which contain the session id for the APM session. If those don't exist, you know there's no valid session.
if { not ([HTTP::cookie exists "MRHSession"] || [HTTP::cookie exists "LastMRH_Session"]) } {
HTTP::respond 302 "http://something.org" "Connection" "Close"
}
This is a very basic way of checking, but should be effective. the
[ACCESS::policy result]
will be "allow", "deny" or ""
from what I've seen. So you could make the checks more complex if necessary, but this should give you an idea.
You can check out the this link for more info on ACCESS::session.
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