Figured out the solution; just posting here if it helps anyone.

I create custom config endpoint to ignore my endpoint and then added the 
filename 
in org.springframework.boot.autoconfigure.AutoConfiguration.imports so that 
it can discover the config class

package com.test.config;

import org.apereo.cas.CasProtocolConstants;
import org.apereo.cas.web.CasWebSecurityConfigurer;
import org.apache.commons.lang3.StringUtils;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

import java.util.List;

@Configuration
public class CustomCasCoreWebEndpointsConfiguration {

@Bean
@Primary // Optional: Makes this bean the preferred one if there are 
multiple beans of the same type
public CasWebSecurityConfigurer<Void> casProtocolEndpointConfigurer() {
return new CasWebSecurityConfigurer<Void>() {
@Override
public List<String> getIgnoredEndpoints() {
// Custom implementation
return List.of(
StringUtils.prependIfMissing(CasProtocolConstants.ENDPOINT_LOGIN, "/"),
StringUtils.prependIfMissing(CasProtocolConstants.ENDPOINT_LOGOUT, "/"),
StringUtils.prependIfMissing(CasProtocolConstants.ENDPOINT_VALIDATE, "/"),
StringUtils.prependIfMissing(CasProtocolConstants.ENDPOINT_SERVICE_VALIDATE, 
"/"),
StringUtils.prependIfMissing(CasProtocolConstants.ENDPOINT_PROXY, "/"),
"/sso/status" // Add your custom endpoint here
);
}
};
}
}


On Monday, January 20, 2025 at 1:15:07 PM UTC-5 Ankit Kumar wrote:

> I was able to add bean in CasOverlayOverrideConfiguration of Cas overlay 
> project and i am able to see in localhost:8443/cas/swagger-ui/index.html my 
> new controller endpoint.  Now I have been trying to look for way to update 
> CasWebSecurityConfigurerAdapter so that i can add my endpoint for 
> CasWebSecurityConfigurerAdapter : Configuring protocol endpoints 
> [[/login**, /login/**, /logout**, /logout/**, /validate**, ... to 
> exclude/ignore from http security
>
> My main goal is to create new endpoint and then create service class which 
> would extend  
>
> AbstractUsernamePasswordAuthenticationHandler and then override 
> authenticateUsernamePasswordInternal.
>
> We currently do that for cas 3.x version and as part of upgrading to 7.1.3 
> we are essentially rewriting the app.
>
> I have been stuck on this problem for atleast a week and would appreciate 
> some help.
>
> Thanks
>
>

-- 
- Website: https://apereo.github.io/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 cas-user+unsubscr...@apereo.org.
To view this discussion visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/c0873e32-558b-48cc-98d3-e039cf9bd133n%40apereo.org.

Reply via email to