Forum Discussion
tikshoret
Nimbostratus
Feb 18, 2015redircert traffic to a specific resource using HTTP:HEADER
Hi all,
maybe you can help me save lots of time
in APM version 11.3.0 i need to redirect traffic to a webtop resource base on HTTP Header.
i mean that after the user authenticate i need to check if t...
Michael_Jenkins
Cirrostratus
Feb 18, 2015You know, I'm not sure you can assign multiple webtops, so you may just have to have the logic assign a webtop which will won't change throughout the entire session. Since the
HTTP_REQUEST executes prior to the session getting created, you may run into a problem with this. You might consider setting a variable in the HTTP_REQUEST event and then using the ACCESS_SESSION_STARTED event to set the session variable when the session gets initialized. From there, you could assign the right webtop based on that variable (I'd recommend using a single session variable and letting the value be something sepcific, or default to an empty string if no match). At that point, the webtop would be assigned and when the policy finishes (assuming you're not doing any redirection away from the webtop after login completes), they should see the desired webtop. Perhaps something like this:
when HTTP_REQUEST {
if { [HTTP::header exists "HEADER_NAME"] } {
log local0 "HEADER_NAME EXISTS"
set headerName "HEADER_NAME"
}
}
when ACCESS_SESSION_STARTED {
Check that the variable exists
if { [info exists headerName] } {
switch $headerName {
"HEADER_NAME_1" {
ACCESS::session data set session.custom.WHATEVER "value_1"
}
"HEADER_NAME_2" {
ACCESS::session data set session.custom.WHATEVER "value_2"
}
}
}
}
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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