tdaish
Aug 15, 2023Altostratus
Solved
APM AdAuth HTTP Header Insert iRule Switch Statement
Hi folks, first forum post here, looking for a hand with iRules! Currently when a user connects from their PC to the Virtual Server, as part of the Access Policy they are presented with an Logon Pa...
- Aug 17, 2023
As Jason said, there are many ways to do this and your method looks fine. But note your typo in IP::client_addr. And it is good practise to use -- to terminate switch options.
You could also do this by checking whether the header already exists
when ACCESS_ACL_ALLOWED { if { ! [HTTP::header exists iv-user] } { HTTP::header insert "iv-user" [ACCESS::session data get "session.logon.last.username"] } } }
- Aug 21, 2023
Doh! My bad, thanks for that. I did find that the F5 does not like:
// do nothing
within those braces, so I have omitted the contents and left it as:
when ACCESS_ACL_ALLOWED { switch -- [IP::client_addr] { "10.0.0.1" - "10.0.0.2" {} default { HTTP::header insert "iv-user" [ACCESS::session data get "session.logon.last.username"] } } }
This should be okay right?