Forum Discussion
ehergott_345008
Apr 06, 2018Nimbostratus
Adding session variable into Portal Access resouce header value
I have a portal resource access object working fine and passing the headers I assign. However when I try to insert a value of a session variable into the header value I do not get the actual session ...
youssef1
Apr 09, 2018Cumulonimbus
Hello,
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
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects