Although it is an old thread, I propose a solution in case someone arrives 
here in the future.

If we add a rewrites.config file to the overlay, in the 
src/main/resources/container/tomcat/ folder, CAS will load it at the 
application level and the embedded tomcat will apply it for routes under 
/cas.
So with an entry like this: 
RewriteCond %{REQUEST_URI} ^/cas/adminlogin$
RewriteRule ^(.*)$ https://cas.example.com/cas [R=301,L]
we can block access to adminlogin.

El viernes, 13 de noviembre de 2020 a las 9:38:21 UTC+1, 
[email protected] escribió:

> Thanks for this. We also needed to remove the endpoint for security 
> reasons. 
> Op vrijdag 22 mei 2020 om 15:03:19 UTC+2 schreef Hedley Proctor:
>
>> The approach we've ended up taking is to have a configuration class as 
>> follows:
>>
>> @Configuration("myCasConfiguration")
>> @EnableConfigurationProperties(CasConfigurationProperties.class)
>> public class MyCasConfiguration implements WebMvcConfigurer {
>>
>>     public void addViewControllers(ViewControllerRegistry registry) {
>>         // Map "/adminlogin to invalid location"
>>         registry.addRedirectViewController("/adminlogin", "notfound");
>>         registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
>>     }
>> }
>>
>

-- 
- 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/dc9ab7e8-6afb-4cb6-ab02-91be8394ad3en%40apereo.org.

Reply via email to