spring-security-adfs-saml2 icon indicating copy to clipboard operation
spring-security-adfs-saml2 copied to clipboard

Not working with Spring Boot 2.6 without allowing circular dependencies

Open amarchino opened this issue 2 years ago • 0 comments

Trying to upgrade the Spring Boot version of an application from 2.4 to 2.6, I found that the dependency for the ADFS connection actually suffers from some circular dependencies.

At first, I found that the

@Autowired
private SAMLAuthenticationProvider samlAuthenticationProvider;

field clashes with the

@Bean
public SAMLAuthenticationProvider samlAuthenticationProvider()

declaration. Yet, after removing the field and just using the bean configuration, Spring reported a dependency loop between samlEntryPoint and samlIDPDiscovery that I could not find a patch for.

These are obviously "resolved" by using the configuration

spring.main.allow-circular-references=true

amarchino avatar Dec 06 '21 15:12 amarchino