Forum Discussion

Mark_van_D's avatar
Mark_van_D
Icon for Cirrostratus rankCirrostratus
Jun 21, 2012

iRule to capture APM External Logon Page Variables

Hi there,

I've got an APM enabled VS that redirects users to an external logon page to collect logon details as well as a couple of other variables. When the user submits credentials it posts them back to the APM enabled VS "/my.policy". This works fine for the username and password, but there are a couple of other variables that are posted back as well that I can't seem to capture.

I tried to use the following irule, but that does not collect any information.

when HTTP_REQUEST {
    check for post request
    set url 0
    if  {[HTTP::uri] starts_with "/my.policy" and [HTTP::method] eq "POST"}{
    set url 1
    set my_content_length [HTTP::header "Content-Length"]
        HTTP::collect $my_content_length
    }}

when HTTP_REQUEST_DATA {
     Set the collected POST variables into keys in the LTM session table 
    if { $url ==1} {
    table set key_variable_01 [findstr [HTTP::payload] variable01 11 "&"] 0 indefinite 
    log local0. "[findstr [HTTP::payload] variable01 11 "&"]"
    HTTP::release
    set url 0
}}

I tried changing the event to "when ACCESS_SESSION_STARTED" but http::collect does not appear to be valid in that event.

Any suggestions?

No RepliesBe the first to reply