Added AuthenticationManager Bean to avoid unnecessary password generation
This closes
@@ -30,7 +30,9 @@ import org.apache.nifi.registry.web.security.authorization.ResourceAuthorization
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
@@ -137,6 +139,17 @@ public class NiFiRegistrySecurityConfig extends WebSecurityConfigurerAdapter {
.authenticationProvider(jwtAuthenticationProvider());
}
+ /**
+ * Provide Authentication Manager Bean to disable unnecessary UserDetailsServiceAutoConfiguration
+ * @return Authentication Manager
+ * @throws Exception Thrown when failing to initialize Authentication Manager
+ */
+ @Bean
+ @Override
+ public AuthenticationManager authenticationManagerBean() throws Exception {
+ return super.authenticationManagerBean();
+ }
+
private IdentityFilter x509AuthenticationFilter() throws Exception {
if (x509AuthenticationFilter == null) {
x509AuthenticationFilter = new IdentityFilter(x509IdentityProvider);
