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 -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -