spring - Difference between AuthenticationManagerBuilder and HttpSecurity.authenticationProvider -


to provide custom authentication provider in spring boot, need both of following? , difference?

authenticationmanagerbuilder

httpsecurity.authenticationprovider(...)

@configuration @enablewebsecurity public class securityconfig extends websecurityconfigureradapter{    @autowired   private myauthenticationprovider myauthenticationprovider;    @autowired   @override   protected void configure(authenticationmanagerbuilder auth) throws exception {       auth.authenticationprovider(myauthenticationprovider);   }    // --------------- or/and ? ----------------   @override   protected void configure(httpsecurity http) throws exception {       http       .authenticationprovider(myauthenticationprovider)       // ...   } } 

you need use 1 of 2 options. internally, http.authenticationprovider making call authenticationmanagerbuilder.authenticationprovider.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

python - Error: Unresolved reference 'selenium' What is the reason? -

asp.net ajax - Jquery scroll to element just goes to top of page -