Yes I had that problem too when I want to create generic library that 
serves as helper to make my microservices CASify. Here is a solution: 
Spring Security CAS calls createServcieUrl of CasAuthenticationEntryPoint 
before every request. This is the place where serviceProperites are used 
for redirection. You can overwrite ServiceProperties with your dynamically 
created url here. But keep in mind that neither I like this solution but no 
choice because of ServiceProperties requires URL on startup which you 
mentioned.

public class DynamicRedirectCasAuthenticationEntryPoint extends 
CasAuthenticationEntryPoint
{

  // ...

   @Override
   protected String createServiceUrl( final HttpServletRequest request, final 
HttpServletResponse response )
   {

      // here set your new serviceProperties based on the request etc. with 
your business logic
      this.setServiceProperties( serviceProperties );
      return super.createServiceUrl( request, response );
   }


  // ...

}

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/f574fc4c-55ca-4c34-bb1f-d751a8f34553%40apereo.org.

Reply via email to