use this iRule to check if external logon is successful. If not, user cannot continue and the session is removed:
hen HTTP_REQUEST {
Check for post requests to the specific external logon URI
if {[HTTP::uri] starts_with "/specific" && [HTTP::method] eq "POST"}{
Collect up to 1Mb of request content
if { [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] < 1048577 } {
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1048576
}
if { $content_length > 0 } {
HTTP::collect $content_length
}
}
}
when HTTP_REQUEST_DATA {
Parse the authenticated value from the collected payload
set authenticated [URI::query "?[HTTP::payload]" authenticated]
HTTP::release
}
when ACCESS_SESSION_STARTED {
if { ![ info exists authenticated ] || authenticated == 0} {
ACCESS::session remove
}
}