4. Create a cookie called SetRequestAuthnContext (as in the example) with a specific cookie value (like in the example; Something) in the redirected referer domain (like in the example; http://abc.com.au)
5. After setting the cookie in the abc.com.au domain; redirect back to the original referer URL (http://foo.com.au/TheApplication)
6. The original referer URL will read the SetRequestAuthnContext cookie and forwarded their browser to a specific element within a original referer URL.
It looks like Santhana’s rule suggests the above steps yet I’m a little lost when it comes to coding the F5 iRule itself.
Here is my first ever attempt at some F5 coding learning from what you started with nitass.
Am I even close?
Fabian
[root@ve10:Active] config b virtual foo_website list
Website No.1 - https://www.foo.com.au/Login/Something
virtual foo_website {
snat automap
pool foo
destination 172.28.19.252:443
ip protocol 6
rules redirect
profiles {
clientssl {
clientside
}
http {}
tcp {}
}
}
iRule No.1 - https://www.foo.com.au/Login/Something redirecting to https://as.abc.com.au/Login/Something
[root@ve10:Active] config b rule redirect list
rule redirect {
when HTTP_REQUEST {
if { [HTTP::host] equals "www.foo.com.au" and [HTTP::uri] starts_with "/Login/Something" } {
HTTP::redirect "https://as.abc.com.au/Login/Something [HTTP::host][HTTP::uri]"
}
}
[root@ve10:Active] config b virtual abc_website list
Website No.2 - https://as.abc.com.au/Login/Something
virtual abc_website {
snat automap
pool foo
destination 172.28.19.253:443
ip protocol 6
rules setcookie
profiles {
clientssl {
clientside
}
http {}
tcp {}
}
}
iRule No.2 - If https://as.abc.com.au/Login/Something then set cookie called setRequestAuthcontext with cookie value of SOMEKEY in the *.abc.com.au domain. Once the cookie is set then redirect back to https://www.foo.com.au/TheApplication
[root@ve10:Active] config b rule setcookie list
rule setcookie {
when HTTP_REQUEST {
set mod_ck 0
if { [HTTP::host] equals "as.abc.com.au" and [HTTP::uri] starts_with "/Login/Something" } {
set mod_ck 1
HTTP::redirect "https://www.foo.com.au/TheApplication [HTTP::host][HTTP::uri]"
}
}
when HTTP_RESPONSE {
if { $mod_ck } {
HTTP::cookie insert name "setRequestAuthContxt" value SOMEKEY domain "abc.com.au"
}
}
}