I'm building a small project using spring boot 2.7.3 and its spring security starter. I'm facing a few problems creating expression based access control. I've read that the method authorizeRequests from HttpSecurity will be deprecated and authorizeHttpRequests will be used instead.
In order to configure my security class, I'm following the steps given in the documentation:
http
.authorizeHttpRequests(authorize -> authorize
.antMatchers("/user/**").access("@webSecurity.check(authentication,request)")
...
)
however it doesn't work causing this error message:
Required type: AuthorizationManager
<org.springframework.security.web.access.intercept.RequestAuthorizationContext>
Provided:
String>
But if I try implementing configuration this way, it works:
http.authorizeRequests()
.antMatchers("/user/**").access("@webSecurity.check(authentication,request);"