inflearn logo
講義

講義

知識共有

junseong Kimさんの投稿

junseong Kim junseong Kim

@gomshiki

レビュー投稿数
3
平均評価
4.7

投稿 2

Q&A

2:00 에서 저처럼 버전 안 맞춰서 해서 헤매는 분들 이걸로 해보세요.

terrinens 님 덕분에 해결했습니다. 감사합니다. 추가로 저는 spring 3.1.5 사용중인데 알려주신 코드대로 했을 때 requestMatchers()에서 Ant 패턴으로 작성하라는 컴파일 에러가 발생해서 아래와 같이 수정했습니다. @Configuration @EnableWebSecurity @EnableMethodSecurity public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity httpSecurity) throws Exception { return httpSecurity .csrf(AbstractHttpConfigurer::disable) .authorizeHttpRequests((registry) -> registry.requestMatchers(new AntPathRequestMatcher("/api/hello")).permitAll() .anyRequest().authenticated() ) .build(); } }

いいね数
0
コメント数
3
閲覧数
1290