Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Clear all filters
Answers

APM access policy default logout URI override based on landing URI?

Hi, we have currently an APM access policy that splits in different branches, based on the landing URI. All works fine, but when we log out, the default behavior is to redirect the client for any further new sessions back to root (/). I know that this can be customized under Access Policy -> Customization, but then it's valid for the entire access profile. We would like to reuse the initial landing URI, so that each application can be relaunched again after logout, with the original landing URI that was previously entered. I don't find any setting in VPE (maybe this logout URI can be overridden by the landing URI by passing a parameter), or does anyone has any experience in doing this with either policies, either iRules? An example would be appreciated :)

1
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Hi Stanislas,

your suggestion was indeed the simplest way forward! I modified the logout page and added a value pointing to the session parameter %{session.server.landinguri}, after struggling a bit with the right syntax... :) So, to implement this, you go as follows:

Access Policy -> Customization:Advanced -> Customization settings -> Access Profiles -> "YOUR PROFILE" -> Logout ->logout.inc

around line 114 replace: <? if ($errorcode != 13) { print('%[new_session]'); ?> <A href='/'>%[new_session_link]<? } ?> by the following: <? if ($errorcode != 13) { print('%[new_session]'); ?> %[new_session_link]<? } ?>

and you're done. I didn't test all cases and all exit branches yet, but for those tested, it worked fine. After hitting the logout button, clients gets the opportunity to start a new session, which will be automatically on the same starting URI as his previous session, and no longer the root (/)

Thanks!

2
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

hmmm, some html lines got interpreted in above... anyway, you should replace the '/' in line 114 href by exactly "%{session.server.landinguri}"

2
Comments on this Answer
Comment made 08-Feb-2017 by Philipp Stadler 286

wokrs great! +1

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

I did not know how to change the default redirect after logout in customization. I did not this before.

If it's possible, did you try to change this value to %{session.server.landinguri} ??

0
Comments on this Answer
Comment made 26-Jan-2018 by Kai Wilke 7293

Cool stuff! +1 ;-)

Cheers, Kai

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

You only removed the <A href='/'> ?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

interesting, this wasn't possible in the past, you had no access to session variables after logoff, that seems to have changed then. which version is this on?

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Here is the code which must be edited (around line 111-117 in version 13.1.0):

        <tr>
            <td class="interaction_table_option_cell"><br><DIV ID="sessionDIV" style='visibility:hidden' align=left></DIV>
                <? if ($errorcode == 0 ) { print("%[success_message]<br>"); }else{ if ($errorcode == 1) { print('%[error_message]<br>'); } else { include_customized_page("errormap", "errormap.inc"); print("<br>"); } } ?>
                <? if ($errorcode != 10 && $errorcode != 1 && $errorcode != 13) { print('<br>%[thank_message]<br>'); } ?><br>
                <? if ($errorcode != 13) { ?><div id="newSessionDIV" style='visibility:hidden'><? print('%[new_session]'); ?> <A href='/'>%[new_session_link]</A></div><? } ?>
            </td>
        </tr>

The third if condition must be edited to replace <A href='/'>%[new_session_link]</A> with <A href='%{session.server.landinguri}'>%[new_session_link]</A>

The new code is :

        <tr>
            <td class="interaction_table_option_cell"><br><DIV ID="sessionDIV" style='visibility:hidden' align=left></DIV>
                <? if ($errorcode == 0 ) { print("%[success_message]<br>"); }else{ if ($errorcode == 1) { print('%[error_message]<br>'); } else { include_customized_page("errormap", "errormap.inc"); print("<br>"); } } ?>
                <? if ($errorcode != 10 && $errorcode != 1 && $errorcode != 13) { print('<br>%[thank_message]<br>'); } ?><br>
                <? if ($errorcode != 13) { ?><div id="newSessionDIV" style='visibility:hidden'><? print('%[new_session]'); ?> <A href='%{session.server.landinguri}'>%[new_session_link]</A></div><? } ?>
            </td>
        </tr>
0
Comments on this Answer
Comment made 26-Jan-2018 by Kai Wilke 7293

Even better stuff! +1 ;-)

Cheers, Kai

0