Forum Discussion
APM: Inserting headers for back-end servers to process.
I'm trying to take a couple pieces of information out of a consumed SAML assertion on the F5 as the service provider and insert them as headers to the back-end servers. Here is one of the variables in APM that I would like to pass to the servers, session.saml.last.nameIDValue. I'm just having a difficult time trying to figure out how to insert this as headers and it make it to the back-end server's. I tried this, which creates the headers because it logs them after there created, but they never make it to the application server after the APM policy is complete. Any help you guys could provide would be great.
when ACCESS_POLICY_AGENT_EVENT {
switch [ACCESS::policy agent_id] {
"HEADERINSERT" {
log local0. "session.saml.last.nameIDValue: [ACCESS::session data get session.saml.last.nameIDValue]"
log local0. "session.saml.last.attr.name.xprole: [ACCESS::session data get session.saml.last.attr.name.xprole]"
HTTP::header insert test1 "[ACCESS::session data get session.saml.last.nameIDValue]"
HTTP::header insert test2 "[ACCESS::session data get session.saml.last.attr.name.xprole]"
log local0. "TEST1: [HTTP::header value test1]"
log local0. "TEST2: [HTTP::header value test2]"
}
}
}
4 Replies
- dubdub
Nimbostratus
Hi Brett,
Not sure if it is of any help, but when I insert SAML values into HTTP headers, I use the ACCESS_ACL_ALLOWED and HTTP_REQUEST events for it. Have you tried test headers in either of those events to see if they get through to the backend web servers?
Thanks, Jen
- bdavis
Nimbostratus
So i can insert them and then log them, but they never make it to the application. So I put a logging statement to log all headers in the when HTTP_REQUEST_SEND { and they are not there. So something is happening to them between the policy allow and when they actually get sent to the servers.
I had the same problem, I created an IIS web site enabled NTLM and did the headers as you did. This worked for me, another problem is redirects, are you doing any redirects? What type of SSO configuration do you have?
- bdavis
Nimbostratus
Thanks guys the actual issue was on the server-side. I was able to insert them in ACCESS_ACL_ALLOWED event as suggested initial above. But when I did it there where issues on the application side and it is now fixed. However the above irule that you provided dubdub made me think I might want to check for existing sessions and re-insert the headers for these, however the application generates a JSESSIONID to track the session after authentication so I may not ever need to. Thank you guys for your help.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
