CAS relative redirect

58 views
Skip to first unread message

Kevin Liu

unread,
Jul 23, 2018, 3:23:16 PM7/23/18
to CAS Community
Is it possible for the cas filter to redirect with a relative path to the entry point? For example if I hit cas1.com and set my redirect to /cas1 it would redirect to cas1.com/cas1 instead of localhost/cas1. 

Ray Bon

unread,
Jul 23, 2018, 3:48:50 PM7/23/18
to cas-...@apereo.org
Kevin,

Are you trying to run two instances of CAS on the same machine/tomcat?
That is, why do you want to change the URL from /cas to /cas1?

Ray

On Mon, 2018-07-23 at 12:23 -0700, Kevin Liu wrote:
Is it possible for the cas filter to redirect with a relative path to the entry point? For example if I hit cas1.com and set my redirect to /cas1 it would redirect to cas1.com/cas1 instead of localhost/cas1. 

-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

Kevin Liu

unread,
Jul 23, 2018, 3:56:35 PM7/23/18
to CAS Community
Hello Ray,

No it's like this. I currently have cas deployed within a container sitting behind a reverse proxy. When users use a webapp without authentication, they will get redirect to dnsname.com/cas endpoint on the proxy which will then send them to cas. The problem is the dnsname.com will be dynamic based on the deployment environment. So I was hoping to have a cas filter where it'll just append /cas to the incoming request dnsname.

Ray Bon

unread,
Jul 23, 2018, 4:52:41 PM7/23/18
to cas-...@apereo.org
Kevin,

Could the deployment process create a properties file with a value set for dnsname?
In properties file:
cas.server.url={dnsname}/cas

In application context or where ever the filter is defined:

    <bean name="authenticationFilter"
          class="org.jasig.cas.client.authentication.AuthenticationFilter">
        <property name="casServerLoginUrl" value="${cas.server.url}/login" />
        <property name="serverName" value="{servicehost}" />
    </bean>

Ray

Kevin Liu

unread,
Jul 23, 2018, 6:54:35 PM7/23/18
to CAS Community
Ray,

Can cas.properties pick up env variables? That could work in that case.

Kevin

Ray Bon

unread,
Jul 24, 2018, 12:33:08 PM7/24/18
to cas-...@apereo.org
Kevin,

You can set environment variables on the command line (-Dvar=blah) and in tomcat/bin/setenv.sh.


Ray

Kevin Liu

unread,
Aug 10, 2018, 2:12:17 PM8/10/18
to CAS Community
How hard would it be to modify the filters to include relative redirect paths? 

Ray Bon

unread,
Aug 10, 2018, 2:23:38 PM8/10/18
to cas-...@apereo.org
Filters, in general, are 'relatively simple'. Take a look at https://github.com/apereo/java-cas-client

Ray
Reply all
Reply to author
Forward
0 new messages