Forum Discussion

5 Replies

  • Hi,


    you simply create an assign variable before the end of your VPE and you set it as follows:


    You can do IT manually, this means that whatever the user enters as URL, he will be redirected to the desired URL at the end of the authentication process.


    Custom variables:



    custom Expression:

    return "/myurl/"


    otherwise the APM does it automatically. with the landing URI.

    keep me in touch if you need more details. and if I answer to your need.


  • Thank you for your fast response.


    This is our expected behavior:

    • An internal application generates a link to an internal ressource (e.g. a downloadable PDF, etc.) and sends it by email to various recepients.
    • From the internet, when the user follows the recieved link, and is promted to authenticate via APM.
    • After successful authentication, the user needs to see the intended ressource. I.e. download the PDF.


    Current behaviror:

    • After successful authentication, the user is redirected to the homepage of the web app. He needs extra navigation steps to get to the desired resource.
  • Sajid's avatar
    Icon for Cirrostratus rankCirrostratus

    Hi Mohammed,


    Yes, I have achieved this for ezproxy (SaaS) application with SAML.


    You need irule for landinguri



      switch -glob [string tolower [ACCESS::session data get session.server.landinguri]] {




    1. when HTTP_REQUEST {
    2. if { ( [HTTP::cookie exists MRHSession] ) and not ( [ACCESS::session exists -state_allow [HTTP::cookie value MRHSession]] ) } {
    3. if { ( [HTTP::uri] ne [ACCESS::session data get session.server.landinguri] ) and not ( [ACCESS::session data get session.server.landinguri] eq "" ) } {
    4. HTTP::redirect [ACCESS::session data get session.server.landinguri]
    5. }
    6. }
    7. }




    K91940158: How to auto-launch SAML SP resources



  • Hi,

    You have a strange behaviour.

    By design, APM redirect the user to the session.server.landinguri after APM policy completed.

    The session.server.landinguri is filled with the very first request the user do to your application. So, this var should be good for your need.

    Can you test this irule by the way:

      set mylandinguri [ACCESS::session data get "session.server.landinguri"]
      ACCESS::respond 302 "Location" "$mylandinguri" "Connection" "Close"

    It will respond to your need.


    • Nikoolayy1's avatar
      Icon for MVP rankMVP

      Have you tested this irule as on this breaks the web page and there are TCL errors? I think that ACCESS:respond works well to return a custom page if the auth fails or the access policy is successfull but not for redirection.