Redirecting users based on a server variable


(Birdg) #1
Hi,
 
We are on 5.0.2.
 
We are integrating with an external system for single sign-on. We pick up whether the user is logged in over SSO by checking the REMOTE_USER server variable within Matrix.
 
We have a need to redirect site visitors whose REMOTE_USER is not set to the SSO login page.
 
What's the best way to do this within Matrix?
 
Thanks,
 
Graham

(Bart Banda) #2

Hi Graham,

the users that are logging in, are they part of a specific matrix user group? If so, you could probably do some redirect based on if they are logged in and if they are a part of that user group?

Also, what redirect method are you using, a trigger or a redirect page or just client side JS?


(Birdg) #3

Hi Bart,

Thanks for your reply. The users are not logged into Matrix and there are not corresponding user assets for them. They are only logged into our organisation-wide SSO system and this is detected via the Remote_user global.


Ideally we want to check whether they are logged in under SSO and redirect them if they are not.


I am also aware that we should be doing this without breaking the Squid/Matrix cache.


In that case I think the options would be either using JS (not really an option because people could bypass it by turning JS off) or acting higher up in our infrastructure (ie redirecting at the load balancer).


Is a trigger a possibility or will this mean pages can’t be cached?


Thanks,


Graham


(Bart Banda) #4

In that case I think the options would be either using JS (not really an option because people could bypass it by turning JS off) or acting higher up in our infrastructure (ie redirecting at the load balancer).

 

Pretty much, if you want it to work with cache as well, you need to do it higher up. 

 

Is a trigger a possibility or will this mean pages can't be cached?

 

That's right, you would need to disable cache to effectively use that, or a paint layout/standard page condition. 

 

Sounds like doing it higher up is your preferred solution here, or do it with JS.