Forum Discussion

TJMohr_289776's avatar
TJMohr_289776
Icon for Nimbostratus rankNimbostratus
May 17, 2017

APM Redirect Based on Decision Box Choice

Hello everyone,

I'm having some trouble figuring out the best way to solve this problem. We have a Citrix deployment using APM, but depending on a choice made in a decision box earlier in the APM flow, the user needs to be redirected to a different URI. It can't be all users of the APM profile, only users who are now on the bottom fork of the APM flow.

Decision 1 - https://www.example.com/Citrix/XenApp1

Decision 2 - https://www.example.com/Citrix/XenApp2

I've tried to figure out the syntax for the APM iRule agents, but that doesn't seem to like using the following when starting the iRule with "

when
ACCESS_POLICY_AGENT_EVENT {`" section.

   if { [HTTP::uri] == "/" } {
        log local0. "Redirecting to /Citrix/XenApp2/"
        ACCESS::respond 302 Location "https://[HTTP::host]/Citrix/XenApp2/"
    }

Any assistance would be greatly appreciated!

Thank you,

-TJ

2 Replies

  • Hi,

    you can use this irule without any irule event (not tested).

    when ACCESS_POLICY_COMPLETED {
        if {[ACCESS::session data get session.server.landinguri] equals "/"} {
            if {[ACCESS::session data get session.decision_box.last.result]} {
                ACCESS::session data set session.server.landinguri "/Citrix/XenApp1/"
            } else {
                ACCESS::session data set session.server.landinguri "/Citrix/XenApp2/"
            }
        }
    }
    

    this will change the redirect after authentication to the expected URI