inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

묻고 답해요

176만명의 커뮤니티!! 함께 토론해봐요.

invalidateHttpSession, clearAuthentication 메서드에 관하여

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 강의 잘 수강하고 있습니다. 질문이 있어 글 남기게 되었습니다. SecurityContext 는 기본적으로 SecurityContextHolder 에 의해 관리되며, 기본적으로 ThreadLocal 변수에 저장된다고 알고 있습니다. TreadLocal 은 스레드별로 독립적으로 생성되는 변수라고 알고 있는데, 그러면 invalidateHttpSession 메서드는 서버의 세션을 무효화하는 기능이고, clearAuthentication 메서드는 현재 스레드의 SecurityContext 에서 Authenitcation 을 삭제하는거라고 이해하면 될까요?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김동현 댓글 2 좋아요 0 조회수 330

커스텀 UserDetailService 구현하기 중 질문사항이 있습니다!

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

항상 퀄리티 높은 강의 감사합니다! 몇가지 궁금한게 있어서 질문드립니다. @Service어노테이션으로 인해 이미 빈으로 등록되어서 .userDetailsService(userDetailsService) 을 쓰지 않아도 자동으로 등록이 되는걸로 알고있었는데 코드를 쓰는 이유가 있나요? 왜 @Service 이름을 " userDetailsService" 로 하신건지 궁금합니다. SecurityConfig 에서 private final UserDetailsService userDetailsService; 에서 FormUserDetailsService 대신 UserDetailsService 을 쓰는 이유가 뭔지 궁금합니다. (그냥 클래스를 그대로 쓰면 안되는건가요?)

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김동준 댓글 2 좋아요 0 조회수 266

교재 문의

미해결

2026년 CPPG 자격증 취득 과정 (최신판)

첫강의 어디에 수업자료 이야기가 있나요? 다 들었는데 없는거 같아요..

  • security
  • cppg(개인정보관리사)
문지민 댓글 1 좋아요 0 조회수 418

질문있습니다

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요, 좋은 강의 제공해주셔서 감사합니다. FilterChainProxy 타입의 빈을 등록했는데 왜 CompositeFilterChainProxy 타입의 빈이 나오는 궁금합니다. 2. FilterChainProxy 도 여러 개가 존재할 수 있는 걸로 알고, SecurityFilterChain 도 여러 개 존재할 수 있는 것을 배웠습니다. 요청에 따라 FilterChainProxy 와 SecurityFilterChain 을 선택하는 부분에 대한 설명이 없는 것 같은데 맞나요? 이것까지 이해하는건 어렵긴 합니다..

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김동현 댓글 2 좋아요 0 조회수 337

자동 로그인 말고 아이디만 저장하는 기능을 구현하고 싶어요

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

rememberMe 의 흐름상 자동 로그인을 하는 것으로 보이는데 강의 들으면서 나름 커스텀하여 로그인 창이 뜰때 아이디만 저장하기 기능을 추가하고 싶은데 어떻게 해야할까요? 1. 로그인창 a. 처음에는 세션, 쿠키도 없으니 빈칸 로그인 성공이후 로그인 정보의 아이디값을 쿠키 에 넣는다. 로그아웃이후 쿠키가 남아있으면 아이디 란에 아이디를 넣는다. 를 하고 싶어용

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김경용 댓글 1 좋아요 0 조회수 540

개인블로그에 강의자료가 올라가도 될까요?

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

강사님 항상 강의잘 듣고 있습니다. 제가 복습을 진행하다 보니 자료가 너무 커서 한눈에 보기 어려워 블로그에 복습및 학습 목적으로 강의 자료를 올려두려고 하는데 괜찮을까요? 물론 강의 링크도 같이 첨부해서 올리겠습니다!

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김동준 댓글 2 좋아요 0 조회수 335

[동시 세션 제어] invalidSessionUrl, expiredUrl API에 대하여

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

동시 세션 제어에서, invalidSessionUrl 경로를 지정하고 expiredUrl 경로를 지정하지 않았을 때 'This session has been expired' 메시지가 나오는데, 한 번 더 새로고침을 하면 정상적으로 invalidSessionUrl 경로로 가네요. ?continue 경로로 302 응답 후 invalidSessionUrl 200 응답으로 되네요. 제 생각에는 버그가 아닐까 싶긴 합니다.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
  • 동시세션제어
쇼콜라끼삐또리 댓글 1 좋아요 2 조회수 305

인메모리 인가방식 질문드립니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 강사님, 실전강의 관련하여 추가질문드립니다. 아래 MapBasedUrlRoleMapper쪽에서 ROLE_ 으로 시작되는 권한은 PersistentUrlRoleMapper를 통해 DB에서 불러오고 나머지는 MapBasedUrlRoleMapper를 사용해서 명시를 할 수 있을까요? public class MapBasedUrlRoleMapper implements UrlRoleMapper{ private final LinkedHashMap<String, String> urlRoleMappings = new LinkedHashMap<>(); @Override public Map<String, String> getUrlRoleMappings() { urlRoleMappings.put("/", "permitAll"); urlRoleMappings.put("/css/**", "permitAll"); urlRoleMappings.put("/js/**", "permitAll"); urlRoleMappings.put("/images/**", "permitAll"); urlRoleMappings.put("/favicon.*", "permitAll"); urlRoleMappings.put("/*/icon-*", "permitAll"); urlRoleMappings.put("/signup", "permitAll"); urlRoleMappings.put("/login", "permitAll"); urlRoleMappings.put("/logout", "permitAll"); urlRoleMappings.put("/denied", "authenticated"); urlRoleMappings.put("/", "ROLE_USER"); urlRoleMappings.put("/user", "ROLE_USER"); urlRoleMappings.put("/admin/**", "ROLE_ADMIN"); urlRoleMappings.put("/manager", "ROLE_MANAGER"); urlRoleMappings.put("/db", "hasRole('DBA')"); return new HashMap<>(urlRoleMappings); } }

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
류혜상 댓글 1 좋아요 0 조회수 239

섹션15 인가 DB 연동부분

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 강사님, 강의를 수강중인 수강생입니다. 궁금한 사항이 있어 질문드립니다. PersistentUrlRoleMapper의 getUrlRoleMapping를 확인해보면 결국 urlRoleMappings 변수의 key value부분이 SecurityFilterChain의 requestMatchers("/admin/**").hasAuthority("ROLE_ADMIN")이 되는것 같습니다. 예를들어 컨트롤러 쪽 api 호출시 /admin/select 는 ROLE_MANAGER, ROLE_ADMIN 접근 가능하며 /admin/insert ROLE_ADMIN만 호출을 허락하려고하면 JPA나 쿼리를 수정해서 urlRoleMappings 에 매핑하면 될지 궁금하여 질문드립니다. 현재 업무중의 테이블이 Role 과 Menu가 있고, Role과 Function이라는 테이블이 있어서, Menu접근에 권한과 Menu하위에 기능별로 다르게 권한을 동적으로 주려고하다보니 해당부분을 수정하면 될것 같아서 질문을 드립니다. public class PersistentUrlRoleMapper implements UrlRoleMapper{ public PersistentUrlRoleMapper(ResourcesRepository resourcesRepository) { this.resourcesRepository = resourcesRepository; } @Override public Map<String, String> getUrlRoleMappings() { urlRoleMappings.clear(); List<Resources> resourcesList = resourcesRepository.findAllResources(); resourcesList.forEach(re -> { re.getRoleSet().forEach(role -> { urlRoleMappings.put(re.getResourceName(), role.getRoleName()); }); }); return urlRoleMappings; } }

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
류혜상 댓글 1 좋아요 0 조회수 249

실전강의 Rest방식 vs formLogin 방식에따른 Rest Fillter 적용여부

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 강사님, 실정강의 중에 궁금한 사항이 있어 질문드립니다. FromLogin방식에서는 CustomFilter를 따로 생성하지 않고 Ajax 비동기 로그인 방식에서만 CustumFilter를 생성하여 http.addFilter 로 필터를 추가하신 내용을 수강중입니다. 궁금산사항은 FormLogin 방식에서는 왜 필터를 추가를 안하고 비동기 통신 로그인 일때만 필터를 추가하는지 그 이유가 궁금하여 질문드립니다.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
류혜상 댓글 2 좋아요 0 조회수 466

JWT 사용관련 질문드립니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 현재 강의 초반부 수강중인 수강생입니다. 혹시 실전프로젝트 자료에 포함된 내용중에 JWT를 사용하여 인증을 하는 예제도 제공이될까요? 아니면 JWT에 대한 예제는 없는걸까요? github에서 제가 못찾는건지 궁금하여 질문드립니다. 사내 업무에서 전통적인 세션기반인증이 아닌 JWT를 사용한 인증을 사용하려다보니 해당내용이 강의자료에는 없는것 같아 질문드립니다. 강의를 전부 수강하지 못하고 질문드리는 점 양해부탁드립니다.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
류혜상 댓글 1 좋아요 0 조회수 415

법률에 관한 규정 관련 질문

해결됨

2026년 CPPG 개인정보관리사 자격증 취득하기 (개정안 반영)

안녕하세요~ 저는 실무에서 다양한 케이스의 HR 정보를 다루고 있는데요, 예로, 사업소득자 원천세 처리를 위하여 주민등록번호를 취급하며, 이 경우 관련 근거를 기재하여 이용 사실을 고지하고 있습니다만, 이처럼 < 법률에 특별한 규정이 있거나 법령상 의무를 준수하기 위하여 불가피한 경우> 에 해당하여 관련 근거를 찾아 명기해야 하는 경우가 너무 어렵습니다. 개인정보 관련 사이트나 시행령에서도 케이스에 맞는 근거가 없더라구요. 다양한 케이스가 있는 비즈니스 환경에서 < 법률에 특별한 규정이 있거나 법령상 의무를 준수하기 위하여 불가피한 경우> 근거를 명확하게 찾는 노하우가 있는지 문의드립니다.

  • security
  • cppg(개인정보관리사)
김현희ia 댓글 1 좋아요 0 조회수 301

WebFlux 방식에서 권한 동적 적용하려고 하는데 잘 안됩니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요. 강사님 강의 듣고 WebFlux 방식에서도 프로그래밍 방식 또는 동적방식으로 권한을 적용해 보고자 이것저것 해보고 있는데요. WebFlux 방식에서는 DelegatingReactiveAuthorizationManager 클래스에서 private final List<ServerWebExchangeMatcherEntry<ReactiveAuthorizationManager<AuthorizationContext>>> mappings; 이 형식으로 mappings를 생성자로 넘겨주거나 생성될때 build add() 메서드로 한건식 넘겨주면 List 형식에 추가되어 요청이 들어오면 아래의 check메서드에서 해당 요청을 체크하는 것 같습니다. @Override public Mono<AuthorizationDecision> check(Mono<Authentication> authentication, ServerWebExchange exchange) { return Flux.fromIterable(this.mappings) .concatMap((mapping) -> mapping.getMatcher() .matches(exchange) .filter(MatchResult::isMatch) .map(MatchResult::getVariables) .flatMap((variables) -> { logger.debug(LogMessage.of(() -> "Checking authorization on '" + exchange.getRequest().getPath().pathWithinApplication() + "' using " + mapping.getEntry())); return mapping.getEntry().check(authentication, new AuthorizationContext(exchange, variables)); })) .next() .defaultIfEmpty(new AuthorizationDecision(false)); } 문제는 mappings 정보를 어떻게 만들어서 넘겨야 할지 감이 안옵니다. .pathMatchers(HttpMethod.GET, "/routes").permitAll() .pathMatchers(HttpMethod.POST, "/auth-server/**").permitAll() .pathMatchers(HttpMethod.POST,"/auth-service/auth/token").permitAll() .pathMatchers(HttpMethod.GET,"/auth-service/api/v1/users").hasRole("ROLE_USER") 이 4개의 pathMatchers를 아래의 형식으로 해서 List로 넘겨야 할듯 한데 어떻게 할 수 있을까요? ServerWebExchangeMatcherEntry<ReactiveAuthorizationManager<AuthorizationContext>>> new ServerWebExchangeMatcherEntry<ReactiveAuthorizationManager<AuthorizationContext>>( ServerWebExchangeMatchers.pathMatchers(HttpMethod.GET, "/auth-service/api/v1/users"), AuthorityReactiveAuthorizationManager.hasRole("ROLE_USER")) 위의 방법으로 객체를 하나하나 만들어서 넘겨보기도 했는데 Role이 지정된 건 적용이 됩니다. 그러나 permitAll()을 시켜줘야 하는 것들은 어떻게 적용시켜야 할지... 하루종일 방법을 찾아봤는데 내공 부족으로 인하여 못찾고 해매고 있습니다. 도움 부탁드립니다.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
aanicall 댓글 2 좋아요 0 조회수 465

세션 고정 공격 상황에 대해서 질문있습니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

수업에서 배운 세션 고정 공격은 먼저 공격자가 서버에 로그인 인증을 완료한 후 세션ID를 받은 뒤에 피해자에게 몰래 심는 거잖아요. 해당 세션ID로 피해자가 서버에 접속하는 걸텐데, 서버 입장에선 공격자의 신상으로 이미 인증이 되어 있어서 피해자의 모든 요청에 허용을 하지 않을까요? 굳이 피해자가 다시 로그인을 하는 상황이 머릿속에 그려지지 않습니다. 또 피해자가 사이트에 접속했을 때 이미 인증이 되어 있기 때문에 다른 사람으로 로그인이 되어 있을테고, 그러면 오히려 공격자의 신상이 피해자에게 노출되는 꼴 아닌가요..? ㅎㅎ 그렇다고 피해자가 다시 로그인을 하기 위해서 로그아웃하는 순간 악의적인 세션ID는 더 이상 사용하지 못하게 되구요.. 궁금합니다!

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
김동민 댓글 2 좋아요 0 조회수 547

RestAuthenticationFilter에 jwt 토큰을 추가하는 질문

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요 선생님 현재 실전 프로젝트 20 restDsl까지 적용하여 저의 개인 프로젝트를 진행 중에 있습니다 세션 방식은 문제없이 동작을 하지만 토큰으로 변경을 하고자 하니 문제가 생겼습니다 질문 1. 기존 RestAuthenticationFilter을 그대로 사용하고 RestAuthenticationSuccessHandler에서 인증이 완료가 되면 토큰을 발급하여 헤더로 보내주는 것이 가능할가요? 1 방식이 가능하다면 정상 발급된 토큰을 확인하는 필터를 RestAuthenticationFilter 앞에 추가하도록 하여 인증을 유지하고 싶습니다 또한 실제 인증 처리는 Provider 쪽에서 진행이 된다고 강의에서 배웠는데 JwtAuthenticationProvider라는 클래스를 따로 하나 만들어 또 하나의 restFilter를 생성하여 @Order로 우선순위를 주고 새로이 인증을 처리하는 방식이 맞을까요? 이상이 제가 질문 드리고 싶은 부분들 입니다. 혹시 틀린 점이나 추가해야 하는 점이 있다면 조언 부탁 드립니다..

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
응애자바 댓글 2 좋아요 0 조회수 309

혹시 webflux 방식에서도 동적 커스텀 권한 관리가 가능할까요?

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

안녕하세요. 강의 열심히 듣고 이것저것 많이 배우고 있습니다. 강사님 강의 중 동적으로 권한 정보를 읽어다 적용하는 부분을 배웠습니다. 혹시 webflux 방식에서도 동적 커스텀 권한 관리가 가능할까요? 자료를 찾아봐도 딱히 방법에 대해 자료가 많이 검색이 되지 않는데 가능 여부만이라도 확인이 가능할까 해서 여쭤봅니다.

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
aanicall 댓글 2 좋아요 0 조회수 270

건의드립니다.

미해결

2026년 CPPG 개인정보관리사 자격증 취득하기 (개정안 반영)

안녕하세요 얼마전 강의자료 문의드렸던 학생입니다. 요약노트집으로도 공부 해보려했는데 강의를 들으면서, 목차가 상이하여 어렵더라고요 인프런에서도 캡처기능을 제공해서 아래와같이 강의자료를 따로 삼성노트에 일일이 캡처하여 공부 하고있습니다.이런 작업이 번거로워 강의자료를 아래와 같이 워터마크 형식으로 제공하는게 어떨까 싶어 건의드립니다.

  • security
  • cppg(개인정보관리사)
hj 댓글 3 좋아요 1 조회수 415

비동기 인증까지 한 상태이며, 배포 목적으로 빌드 시 에러가 발생합니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

ubuntu@ip-172-31-86-200:~/memberCertification$ ./gradlew clean build Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 15s 8 actionable tasks: 8 executed ubuntu@ip-172-31-86-200:~/memberCertification$ ./gradlew clean build > Task :test MemberCertificationApplicationTests > contextLoads() FAILED java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180 Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1773 Caused by: org.hibernate.service.spi.ServiceException at AbstractServiceRegistryImpl.java:276 Caused by: org.hibernate.HibernateException at DialectFactoryImpl.java:191 1 test completed, 1 failed > Task :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > There were failing tests. See the report at: file:///home/ubuntu/memberCertification/build/reports/tests/test/index.html * Try: > Run with --scan to get full insights. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 15s 8 actionable tasks: 8 executed ubuntu@ip-172-31-86-200:~/memberCertification$ ./gradlew clean build > Task :test MemberCertificationApplicationTests > contextLoads() FAILED java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:180 Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1773 Caused by: org.hibernate.service.spi.ServiceException at AbstractServiceRegistryImpl.java:276 Caused by: org.hibernate.HibernateException at DialectFactoryImpl.java:191 1 test completed, 1 failed > Task :test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':test'. > There were failing tests. See the report at: file:///home/ubuntu/memberCertification/build/reports/tests/test/index.html * Try: > Run with --scan to get full insights. Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 14s 8 actionable tasks: 8 executed 구글에 검색해본 결과, java: error: invalid flag: --warning-mode=all을 하면 된다는 글을 보고 Preferences > Compiler > java Compiler에 --warning-mode all --stacktrace 입력을 하고 실행을 해봤습니다. java: error: invalid flag: --warning-mode=all가 발생하며 실행이 되지 않습니다. 어떻게 해야 에러를 고칠 수 있을까요 ?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
JJEONG 댓글 1 좋아요 0 조회수 477

Build and run using과 Run tests using을 Gradle이 아닌 InteliJ IDEA로 실행하면 해당 에러가 발생합니다.

미해결

스프링 시큐리티 완전 정복 [6.x 개정판]

Description: Parameter 0 of constructor in com.example.membercertification.security.config.SecurityConfig required a single bean, but 2 were found: - authenticationProvider: defined in file [/Users/jjeong/Desktop/study/memberCertification/out/production/classes/com/example/membercertification/security/provider/FormAuthenticationProvider.class] - restAuthenticationProvider: defined in file [/Users/jjeong/Desktop/study/memberCertification/out/production/classes/com/example/membercertification/security/provider/RestAuthenticationProvider.class] This may be due to missing parameter name information Action: Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed Ensure that your compiler is configured to use the '-parameters' flag. You may need to update both your build tool settings as well as your IDE. (See https://github.com/spring-projects/spring-framework/wiki/Upgrading-to-Spring-Framework-6.x#parameter-name-retention) 해당 에러에서 적힌 provider 2개를 @Qualifier와 @Primary로 설정하면 /api에서 로그인 할 경우, 로그인 영속성이 안 되는데 어떻게 해결해야 하나요 ?

  • spring
  • spring-boot
  • spring-security
  • security
  • web-security
JJEONG 댓글 1 좋아요 0 조회수 250

강의자료 받을수있나요?

해결됨

2026년 CPPG 개인정보관리사 자격증 취득하기 (개정안 반영)

강의 진행하실때 사용하는 자료(영상에 나오는 자료, 스크립트) 받을수있나요? 네이버 스마트스토어에서 판매하시는건 구매한상태입니다.

  • security
  • cppg(개인정보관리사)
hj 댓글 1 좋아요 0 조회수 293

인기 태그

인프런 TOP Writers

주간 인기글