springsecurity

· TIL
의존성 목록 dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' testImplementation 'org.springframework.boot:spring-boot-starter-test' testRuntimeOnly 'org.junit.platform:junit-platform-launcher'}의존성이 web, lombok 밖에 없다.  전역 설정 import org.springframework.context.annotat..
· TIL
문제 스프링 시큐리티로 API 인가 설정 중, /api/boards/best 는 권한 검증 없이 전부 볼 수 있지만, api/boards/{id} 는 검증을 해야하는 상황에서, new AntPathRequestMatcher("/api/boards/best", HttpMethod.GET.name()) new AntPathRequestMatcher("/api/boards/{id}", HttpMethod.GET.name()) 위의 두 API에서 best 와 {id}를 구별하지 못하는 문제가 있었다. 해결 스프링 시큐리티는 정규표현식으로도 매칭을 할 수 있는 클래스를 제공한다. new AntPathRequestMatcher("/api/boards/best", HttpMethod.GET.name()) new Re..
· TIL
오늘 스프링 시큐리티를 다루다가 겪었던 에러다. 과제 제출 5분전까지 해결을 못해서 일단 제출하고 고쳤다 ㅋ 문제 Spring security filter 추가 IllegalArgumentException : does not have a registered order 에러 발생 해결 @Bean public JwtFilter jwtFilter() { return new JwtFilter(jwtUtil, userDetailsService); } @Bean public ExceptionHandleFilter exceptionHandleFilter() { return new ExceptionHandleFilter(); } @Bean public SecurityFilterChain securityFilterCha..
yunjae62
'springsecurity' 태그의 글 목록