Forum Discussion

Karl_Billington's avatar
Karl_Billington
Icon for Nimbostratus rankNimbostratus
Oct 07, 2014

Create HTTP POST from APM

Hi,

 

I have a requirement in APM that will allow the user to click a checkbox and have the F5 end off a HTTP POST to an application on another server to trigger the OTP creating and email the OTP to the user. All the F5 needs to do is send a HTTP post to a particular URL with the correct header and body. When I look at the iRules, all the HTTP commands seem to relate to altering an existing HTTP REQUEST EVENT. Is there a way to create a new HTTP request? I'm sure this is not as difficult as it seems, but I am new to iRules.

 

Another part to this is how can an iRule check the status of a checkbox within the login page?

 

Thanks for your help.

 

3 Replies

  • sounds like a side band connection might be able to do what you want on the sending of the post.

     

    https://devcentral.f5.com/wiki/irules.SIDEBAND.ashx

     

    but to have this happen when you click a checkbox, you mean a [ ] type of element right? that i don't see happen, you probably need another element from the VPE for that, a choice with an irule event or such.

     

  • Hi Karl,

     

    You should be able to get started with this devcentral article https://devcentral.f5.com/articles/v11-irules-intro-to-sideband-connections.

     

    The theory would be to create a POST using the sideband connection in an iRule.

     

    I would suggest using an iRule Event in the APM Policy after the logon page. You can either use the checkbox value in the iRule to see if you want to send the OTP message or you can key off the session variable and take a different branch if they want to use OTP (where you will fire the iRule) or not.

     

    You can use this article as a reference as it describes using checkboxes on the logon page and working with the value in an iRule.

     

    https://devcentral.f5.com/articles/add-outlook-web-access-login-options-to-the-apm-logon-page

     

    I believe in 11.5 checkboxes were introduce in the logon page config screen so you will not have to do the advanced customization described in the article to get the checkbox to show.

     

    Please let me know if you have any questions or if you have trouble with the code and I will see what I can do to help.

     

    Regards,

     

    Seth Cooper

     

  • THi's avatar
    THi
    Icon for Nimbostratus rankNimbostratus

    The HTTP AAA / HTTP Auth is a simple way to do sideband connection within VPE, in many cases without iRules:

     

    • add an HTTP AAA server, with Custom POST method, with action to the specific OTP server URL, then add headers and content as you like, match to desired return value (eg. 200 OK)
    • add a logon page with radio button to select "OTP" and with a branch rule continue to HTTP Auth box, which will perform the HTTP Post and match the return value