diff --git a/src/main/kotlin/no/nav/gandalf/config/SecurityConfig.kt b/src/main/kotlin/no/nav/gandalf/config/SecurityConfig.kt index 88013492..716f46f8 100644 --- a/src/main/kotlin/no/nav/gandalf/config/SecurityConfig.kt +++ b/src/main/kotlin/no/nav/gandalf/config/SecurityConfig.kt @@ -10,6 +10,7 @@ import no.nav.gandalf.ldap.LDAPConnectionSetup import no.nav.gandalf.ldap.RestAuthenticationEntryPoint import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Configuration +import org.springframework.context.annotation.Primary import org.springframework.security.authentication.AuthenticationManager import org.springframework.security.authentication.AuthenticationProvider import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder @@ -75,6 +76,7 @@ class SecurityConfig( return super.authenticationManagerBean() } + @Primary @Bean fun activeDirectoryLdapAuthenticationProvider(): AuthenticationProvider? { return CustomAuthenticationProvider(LDAPConnectionSetup(ldapConfig))