Because the saml2Login DSL calls HttpSecurity#authenticationProvider to register its AuthenticationProvider, this overrides when an application declares OpenSaml4AuthenticationProvider as a bean.
It's expected that unless an application calls HttpSecurity#authenticationProvider, then the bean declaration should take precedence.