Forum Discussion
youssef1
Cumulonimbus
Apr 09, 2018Hello,
I asked you if you want to insert the header directly from your ressource (Portal access I supposed) or trough an Irule?
If you want to do it trouh an Irule is very simple, you just have to keep in mind that ACCESS_POLICY_AGENT_EVENT is used during APM policy evaluation. If you want to insert header to each request you can put the followin irule:
when HTTP_REQUEST {
if {[ACCESS::policy equals "allow"]} {
HTTP::header insert "usename" [ACCESS::session data get "session.logon.last.username"]
log local0. "LOG INFO: [ACCESS::session data get "session.logon.last.username"]"
}
}
if ever, you can also use the event ACCESS_ACL_ALLOWED ( in every time a request is made )
when ACCESS_ACL_ALLOWED {
set user [ACCESS::session data get "session.logon.last.username"]
HTTP::header insert "usename" $user
log local0. "LOG INFO: $user"
}
Regards