Skip to content

Commit

Permalink
change: make bean Primary
Browse files Browse the repository at this point in the history
  • Loading branch information
ybelMekk committed Jan 14, 2021
1 parent a9db82a commit fa63c97
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/kotlin/no/nav/gandalf/config/SecurityConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -75,6 +76,7 @@ class SecurityConfig(
return super.authenticationManagerBean()
}

@Primary
@Bean
fun activeDirectoryLdapAuthenticationProvider(): AuthenticationProvider? {
return CustomAuthenticationProvider(LDAPConnectionSetup(ldapConfig))
Expand Down

0 comments on commit fa63c97

Please sign in to comment.