수강이 제한됩니다.
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결스프링 시큐리티
successHandler가 작동하지 않습니다.
우선 너무 자주 질문을 드리는 것 같아 죄송합니다.SuccessHandler를 입력하고, 핸들러에 BreakPoint가 작동하지 않아 FailHandler와 denied를 만들어서 작동시켜 봤는데 SuccessHandler이외에는 정상 작동하는 것을 확인했습니다. 저에게는 코드에 이상한 부분이 보이지 않아 질문드리게 되었습니다. 전체 코드는 깃허브 Othkkartho/SpringSecurityLearn: 스프링 시큐리티 인프런 강의에 실전 프로젝트를 직접 해보는 프로젝트입니다. (github.com) 에 branches ch3.9,10,11입니다.
- 해결됨스프링 시큐리티
실전 프로젝트 - 인증 프로세스 Form 인증구현 8) 인증 부가 기능 시크릿 키 관련 오류 질문입니다.
secret_key 키가 다르고 예외도 정상적으로 들어가 지는데 로그인이 정상적으로 작동합니다. 여러 방법으로 고쳐보다가 전혀 이유를 알 수가 없어 이렇게 질문 남깁니다. 아 비밀번호 예외 처리는 정상적으로 작동합니다.혹시 아래 캡쳐 소스가 부족하실 경우 깃허브 주소 Othkkartho/SpringSecurityLearn: 스프링 시큐리티 인프런 강의에 실전 프로젝트를 직접 해보는 프로젝트입니다. (github.com)의 branches ch3.8이 현재 오류가 난 코드입니다. 좋은 강의 감사드립니다.CustomAuthenticationProvider.javaprovidermanager.java
- 미해결스프링 시큐리티
AuthenticationEntryPoint Redirect가 안됩니다.
[하고싶은 로직]jwt를 적용해서 유효기간설정 후 토큰생성하는데 토큰이 만료됐을 때 login page로 넘어가게 하고 싶습니다. [질문]AuthenticationEntryPoint에서 commence 메서드 내 response.sendRedirect로 controller mappin path에 연결해놓고 permiAll에 추가까지 했는데 그냥 넘어가는 거 같습니다. 어떠한 방법이 있ㄴㅏ요?
- 미해결스프링 시큐리티
[질문] SecurityFilterChain 방식에서 질문드립니다.
안녕하세요 강사님. 저는 아래와 같이 하였는데 null 에러가 나서 질문드려요. 소스도 공유합니다.깃헙 : https://github.com/DongWoonKim/core-spring-security-ajax@Bean AuthenticationManager authenticationManager1 (HttpSecurity http) throws Exception { return http.getSharedObject(AuthenticationManager.class); }http .addFilterBefore(new AjaxLoginProcessingFilter() , UsernamePasswordAuthenticationFilter.class );error message{ "timestamp": "2022-09-28T12:58:47.088+00:00", "status": 500, "error": "Internal Server Error", "trace": "java.lang.NullPointerException: Cannot invoke \"org.springframework.security.authentication.AuthenticationManager.authenticate(org.springframework.security.core.Authentication)\" because the return value of \"com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.getAuthenticationManager()\" is null\n\tat com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.attemptAuthentication(AjaxLoginProcessingFilter.java:39)\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:227)\n\tat org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)\n\tat org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)\n\tat org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)\n\tat org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:346)\n\tat org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:221)\n\tat org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186)\n\tat org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)\n\tat org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)\n\tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)\n\tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)\n\tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)\n\tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)\n\tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)\n\tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)\n\tat org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)\n\tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)\n\tat org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)\n\tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)\n\tat org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)\n\tat org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)\n\tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)\n\tat org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)\n\tat org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)\n\tat java.base/java.lang.Thread.run(Thread.java:833)\n", "message": "Cannot invoke \"org.springframework.security.authentication.AuthenticationManager.authenticate(org.springframework.security.core.Authentication)\" because the return value of \"com.example.corespringsecurityajax.security.filter.AjaxLoginProcessingFilter.getAuthenticationManager()\" is null", "path": "/api/login"}
- 미해결스프링 시큐리티
ㄹ
(사진)
- 미해결스프링 시큐리티
실전 프로젝트 강의 소스 공유합니다.
수강생분들께서는 필요하시면 참고하세요!Spring Boot 신규 버전에 맞게 SecurityFilterChain방식으로 되어 있습니다.소스를 공유하는 이유는 개인적으로 Spring Security를 이렇게 자세하고 잘 다루는 강의는 국내에서는 해당강의가 유일무이하다고 생각하며, 이런 좋은 강의를 수강생분들 모두 좀 더 본질에 집중할 수 있도록 조금이나마 도움이 되고자 깃헙 주소를 공유합니다.완성본이라서 추천드리는 참고 방식은 프로젝트를 생성하시고 해당강의를 보면서 진행 하시다 버전 문제 등의 이유들로 막히실 때 참고하시길 추천드립니다. https://github.com/DongWoonKim/core-spring-security
- 미해결스프링 시큐리티
FilterSecurityInterceptor 등록에서 AuthenticationManager 처리는 어떻게 하면 되나요?
안녕하세요 FilterSecurityInterceptor 관련해서 하나 질문이 있어서 글을 남깁니다.FilterSecurityInterceptor를 빈 등록할때 인증매니저도 set해주게 되는데요. 여기서 기존의 인증매니저 override는 아시다시피 이제 쓸수가 없어서...이때 얘는 어떻게 등록하는지 궁금합니다. 확인부탁드립니다.
- 미해결스프링 시큐리티
[코드공유] SecurityFilterChain 사용하신분들 참고하세요!
@Bean public CustomAuthenticationProvider customAuthenticationProvider() { return new CustomAuthenticationProvider(); }제 깃헙도 공유합니다. 필요하신분들은 참고하세요.https://github.com/DongWoonKim/core-spring-security
- 미해결스프링 시큐리티
[질문] SecurityFilterChain 사용시 문의드립니다.
안녕하세요.아래와 같이 빈을 등록해주었는데@Bean AuthenticationManager authenticationManager(AuthenticationManagerBuilder auth) throws Exception { return auth.userDetailsService( userDetailsService ).and().build(); } "already built object" 라는 에러를 발생시키며 예외가 발생되는데 참고할만한 레퍼런스가 있을까요? 아래 깃헙 링크도 공유합니다.https://github.com/DongWoonKim/core-spring-security
- 미해결스프링 시큐리티
스프링 시큐리티 기능 중
안녕하세요 강사님!지금 막 결제해서 강의를 시청하고 있는 학생입니다.다름이 아니라 제가 궁금한 부분이 시큐리티 전체적인 흐름도 있지만 시큐리티를 이용한 목업 기능도 사용을 해보고 싶어서 듣게 되었습니다. 가상 URL?같은 것도 만들 수 있는 거 같았는데 혹시 해당 강의를 끝까지 들으면 저도 목업 기능을 사용할 수 있을까요? 제가 아직 미흡해서 그런지 커리큘럼으로는 잘 모르겠어서요. 좋은 강의 감사합니다!
- 미해결스프링 시큐리티
19:04 SecurityConfig#customConfigurer(HttpSecurity http) 를 생성한 이유가 뭔가요?
지난 강좌에서 AjaxSeucirtyConfig 클래스에서Ajax 관련 작업을 하는 메소드들을 전부 이전시켰습니다.SecurityConfig 에서 aJax 관련 작업을 하는 메소드를 만들고 호출하는 이유를 알 수 있을까요?
- 미해결스프링 시큐리티
config 메소드에서 and() 메소드를 언제 호출해줘야 하나요?
메서드 체이닝 하면서 and() 메서드를 호출하시는 시점이. 누르고 원하는 메소드가 안보일 때 해주는 건가요?아니면 느낌적으로 붙여주고 말고 하는건가요?아니면 명확한 따로 기준이 있나요?
- 미해결스프링 시큐리티
UserDetail @Data 질문드립니다.
올려신 깃헙 소스코드 따라 가면서 따라 치고 있습니다.아래 코드는 제가 작성한 코드인데요.아래 화면에서 에러가 납니다.이 부분 어떻게 해결하신겁니까?
- 미해결스프링 시큐리티
18:43 jquery 파일 들고오는 부분 에러납니다.
강사님 코드처럼제이쿼리파일을 헤드안에 다 두면크롬 소스탭으로 보면 제이쿼리 파일이 보이질 않아서 헤드 시작전에 따로 제이쿼리 불러오는 헤드 밖으로 뺏습니다. 그런데 아래와 같은 에러가 계속 나고있습니다.원인을 모르겠습니다..
- 미해결스프링 시큐리티
14:55 관리자 도구에서 다음 라인 이동하는 단축키가 어떻게되죠?
다 눌러보고있는데..F9번 누르니.. jquery 파일로 넘어갑니다..
- 미해결스프링 시큐리티
타임리프 강의도 있나요?
타임리프 강의도 찍으실 생각있으신가요?저는 공식문서보고 하기에는 너무 어렵네요..타임리프 강의는 유튜브에도 없고 JSP 강의는 많은데..타임리프 강의는 한개도 없는것 같습니다..
- 미해결스프링 시큐리티
안녕하세요. 강사님 문의 드릴게 있습니다.
제가 스프링으로 사이트를 제작하다가 부족함을 느끼고, 강좌를 찾았는데 너무 좋은 강좌를 찾게 된거 같습니다. 그래서 제가 공부를 정리하려고 만든 블로그가 있는데 그곳에 강좌에서 배운 내용을 정리해서 올려도 괜찮을까요? 출처도 표기하겠습니다.
- 미해결스프링 시큐리티
4:37 빈 자동주입을 해준다는 의미인가요?
Method annotated with @Bean is called directly. Use dependency injection instead.스프링 버전을 좀더 높여서 쓰고있는것 같은데요.위와같은 경고메세지가 나옵니다.에러가 아니여서 실행은 또 잘됩니다.혹시 위와 같은 메세지가 나오는 이유가 있을까요?
- 미해결스프링 시큐리티
https://shop.com/address=공격자주소 csrf 값이 없습니다
강의 7분 6초 즈음에 말씀하신 "https://shop.com/address=공격자주소에 대해서는 csrf 토큰 값이 없습니다" 라는 설명이 잘 이해가 되지 않습니다. csrf 토큰은 처음 요청 때 서버로부터 이미 받은 거 아닌가요? 공격자는 나의 csrf 토큰을 모른다고 하셨는데, 어차피 저 링크를 클릭해서 서버로 요청을 보내는 것도 저 아닌가여? 아니면 저런 식으로 요청을 보낼 때 header에 csrf 토큰을 담게끔 코드가 구현되지 않았기 때문에 csrf 토큰이 안 담긴 채로 서버로 보내진다는 뜻인지요...
- 미해결스프링 시큐리티
SecurityFilterChain 으로 하시는 분들께 제코드 공유해요!
혹시 더 나은 방식이 있다면 같이 공유해요!! 다들 화이팅하세요!@Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers("/").permitAll() .antMatchers( "/css/**", "/js/**", "/images/**", "/webjars/**", "/favicon.*", "/*/icon-*" ).permitAll() .antMatchers("/mypage").hasRole("USER") .antMatchers("/message").hasRole("MANAGER") .antMatchers("/config").hasRole("ADMIN") .anyRequest().authenticated(); http .formLogin(); return http.build(); }