Seems like you computing the redirect url could be encapsulated into an implementation of this interface:

https://github.com/Jasig/java-cas-client/blob/master/cas-client-core/src/main/java/org/jasig/cas/client/authentication/AuthenticationRedirectStrategy.java

May or may not be pluggable.