Forum Discussion
Access denied error when trying to retrieve saml token from html body
Hi Kevin,
I want to retrieve the saml token from html body. Attached the code and log. i need to retrive the value from html body.
Please advice, how to retrieve the value from html body.
Code used:
when CLIENT_ACCEPTED { Get the defined pool for this VIP set default_pool [LB::server pool]
Set an initial lookup flag
set gotpath 1
}
when HTTP_REQUEST { set d2 [getfield [HTTP::host] "." 2] set d3 [getfield [HTTP::host] "." 3] set d4 [getfield [HTTP::host] "." 4] set d5 [getfield [HTTP::host] "." 5] set d6 [getfield [HTTP::host] "." 6] set d7 [getfield [HTTP::host] "." 7] set domain ""
foreach part "$d2 $d3 $d4 $d5 $d6 $d7" {
set domain [format "%s.%s" $domain $part]
}
On first request (lookup flag exists) perform lookup
if { $gotpath == 1 } {
Save the original request
set request [HTTP::request]
Change URI for sideband lookup
HTTP::uri "/iam/code.asp"
Change pool to point to sideband web service
pool Rachel_Test_208
}
if { $gotpath == 0 } {
HTTP::cookie insert name "SMSESSION" value $smsession path "/" domain $domain
HTTP::uri "/affwebservices/public/saml2sso?SPID=service_provider&ProtocolBinding=urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
}
}
when HTTP_RESPONSE { If response from web service if { [HTTP::cookie exists "SMSESSION"] } { set smsession "[HTTP::cookie value SMSESSION]" log local0. "smsession$smsession" set gotpath 0 }
}
Log
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