Closed lexburner closed 7 years ago
configureGlobal makes the AuthenticationManager
available to the entire application (i.e. other WebSecurityConfigurerAdapter
instances, method security, etc)
The protected configure
is like an anonymous inner bean where the scope is limited to that of this WebSecurityConfigurerAdapter
.
If you need it exposed as a Bean, you can use authenticationManagerBean
.
Alternatively, you can also just expose one of a UserDetailsService
, AuthenticationProvider
, or AuthenticationManger
as a Bean.
I'm closing this issue. Please reopen if you have further questions
@rwinch I'm a little confused by your
configureGlobal makes the AuthenticationManager available to the entire application
statement. If I use configureGlobal
method like first method shown by @lexburner and @Autowired
it in my service, I get following error on running application:
Field authenticationManager in [classpath].AuthService required a bean of type 'org.springframework.security.authentication.AuthenticationManager' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.security.authentication.AuthenticationManager' in your configuration.
The second method is fine, but I'm not able to use inMemoryAuthentication()
or InMemoryUserDetailsManagerConfigurer
that way.
Not sure if this should be a new issue, though.
Hi , I am using springboot + spring security
i want to config the AuthenticationManager , i hava reading the spring security docs and some springboot security config,but find two way to config
2 using @Override
and the second way maybe also @Override this method,otherwise may cause some mistake(i am not sure)
so my question is : what is the difference bt two cases? another question is i see some issues discuss the
local and global AuthenticationManager , according to me, AuthenticationManager is only one ,
isn't it ? I'm confused.