Spring Boot Security перенос mvcMatchers на Spring Boot 3JAVA

Программисты JAVA общаются здесь
Anonymous
Spring Boot Security перенос mvcMatchers на Spring Boot 3

Сообщение Anonymous »

SecurityFilterChain unsecuredResources(HttpSecurity httpSecurity) throws Exception {

httpSecurity //
.requestMatchers((matchers) -> matchers
.mvcMatchers("/v1/api/smartmeter/hb/guid")
.mvcMatchers("/v1/api/smartmeter/hb/check-mpan"))
.authorizeHttpRequests(authorize -> authorize.anyRequest().permitAll());
return httpSecurity.build();
}

Как мне перенести это на Spring Boot 3?
Я пробовал следующее, но это не работает.
httpSecurity
.authorizeHttpRequests(matchers -> matchers
.requestMatchers("/v1/api/smartmeter/hb/guid").permitAll()
.requestMatchers("/v1/api/smartmeter/hb/check-mpan").permitAll())
.authorizeHttpRequests(matchers -> matchers
.anyRequest().permitAll())


Подробнее здесь: https://stackoverflow.com/questions/789 ... ing-boot-3

Вернуться в «JAVA»