Forum Discussion
Hi,
Sorry, I'm missing something. By design, APM redirect the user to the session.server.landinguri after APM policy completed.
Can you explain a little bit more your need ?
Bye
Yann
- JdTokenRing_173Aug 01, 2017Nimbostratus
Thanks for the interest firstly! I want to change the session.server.landinguri to the uri they originally landed on F5 with. So if a user hits the f5 with /documents/somedoc.pdf I would like to store it and then send them to it after authentication. I thought the landinguri was the var that stored that initial landing not where apm sent them.
So would it be as simple as creating a custom VAR in my policy that stores this initial value and then queue this irule to send them to there instead of the configured landinguri?
so that initial block would read
when ACCESS_SESSION_STARTED {
set landing_uri [ACCESS::session data get "session.user.customvaruri"]
So that would cause the set of the landing_uri later to successfully send them where they needed to go? Also should I use ACCESS_SESSION_COMPLETED instead of STARTED?
Many thanks!
- Yann_DesmarestAug 01, 2017Cirrus
Hi,
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.
I used to modify session.server.landinguri to redirect users to a specific location after authentication complete. So, you can used it as well. The only exception is if you are using Multi-domain SSO configuration, it's a little bit harder.
Yann
- JdTokenRing_173Aug 01, 2017Nimbostratus
So then setting the landinguri after the if block really does nothing. I should use another method like HTTP::redirect? except if I use that I get TCL runtime errors about not being having a valid context.
Given the above, how would you redirect after login?
Many thanks for your time!!
- JdTokenRing_173Aug 01, 2017Nimbostratus
I think I might have found the answer. https://devcentral.f5.com/wiki/iRules.ACCESS__respond.ashx
ACCESS::respond 302 "Location" "$landing_uri" "Connection" "Close" <-- not sure here if this is right docs do not give much in the way of valid operations.
Also I found the irule editor on this site!! Very handy! https://devcentral.f5.com/d/irule-editor
I will be testing this and will post back if this solves it!
- Yann_DesmarestAug 02, 2017Cirrus
Hi,
Why not configuring a variable assign block and just replacing the session.server.landinguri value by your custom value. So that you don't need to develop an irule for that.
Maybe I missed something.
Yann
- Stanislas_Piro2Aug 02, 2017Cumulonimbus
Hi,
instead of changing
, you can provisionsession.server.landinguri
session.policy.result.start_uri
What I saw on different project is the APM redirect to following URI in this order:
session.policy.result.start_uri
session.server.landinguri
variable can be from:session.policy.result.start_uri
- SAML relay state included in IDP assertion
- webtop URL (full, portal, ..)
As Yann previously said, you can set it in a variable assign in VPE instead of irule. If you want to do it in an irule, ACCESS_SESSION_COMPLETED is the best event before redirect.
If you do a redirect with
, some APM tasks will be ignored (ex : session.user.sessiontype is not set which is used in active session to display session type LTM_APM, FULL or other)ACCESS::respond