java - Is @Autowired required on configureGlobal(..) when using @EnableWebSecurity? -


in example there @autowired annotation on configureglobal method:

    @enablewebsecurity     public class multihttpsecurityconfig {       @autowired       public void configureglobal(authenticationmanagerbuilder auth) {           auth               .inmemoryauthentication()                   .withuser("user").password("password").roles("user").and()                   .withuser("admin").password("password").roles("user", "admin");       } 

is necessary or spring automatically inject authenticationbuilder on methods annotated @enablewebsecurity??

the code snippet pulled when-to-use-spring-securitys-antmatcher

according spring documentation @enablewebsecurity annotation switches off default web application security configuration in order let add custom features configureglobal.

configureglobal should @autowired in order authenticationmanagerbuilder bean , define authentication type application.

in conclusion @enablewebsecurity doesn't inject beans, provides way customize web security application.

@enablewebsecurity


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -