APM Cookbook: AutoLaunch SAML Resources
Introduction
After the SAML labs at Agility I got a lot of questions about how to automatically launch SAML resources and skip the webtop, and I promised I'd write it up for you. If you haven't be...
Published Aug 10, 2016
Version 1.0Graham_Alderso1
Employee
Joined May 22, 2019
Graham_Alderso1
Employee
Joined May 22, 2019
Graham_Alderso1
Apr 12, 2017Employee
Yep, I haven't written an iRule that does this yet, but that's the first solution that comes to mind (assuming there's a good Referer header to key off) and you're going down the right path. You'd want to remove the session as well. https://clouddocs.f5.com/api/irules/ACCESS__session.html
 
Actually, in your case since you can control the redirect URL, maybe the simplest is to just choose something like /mycustomlogout and redirect them there, and then your iRule can just look for that instead of bothering with the Referer header.
 
Perhaps try this (untested).
 
when HTTP_REQUEST {
if { [HTTP::uri] equals "/mycustomlogout"} {
ACCESS::session remove
HTTP::redirect "https://mywebsite.com"
}
}