묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
안녕하세요. 호돌맨님. 서비스 정책 로직 위치에 대해 궁금한 점이 있습니다.
좋은 강의 정말 감사드립니다. 강의 수강 도중 서비스 로직 관련 궁금한 점이 있어 문의드리게 되었습니다.제가 DDD 를 공부하면서 알게된 부분이 DDD 에서는 비즈니스 로직을 도메인에 몰아서 작성하라고 했는데 본 강의에서는 절대 서비스 정책을 도메인에 둬서는 안된다고 말씀하신 걸로 알고 있습니다. 호돌맨님께서 말씀하신 서비스 정책을 두지 말라는 조언은 DDD를 적용하지 않았기 때문인지 두지 말라고 하신건지 알고 싶습니다.(서비스 정책 == 비즈니스 로직으로 이해했습니다. 혹시 제가 이해한 부분이 잘못 됐을까요?)감사합니다.
-
미해결스프링부트 시큐리티 & JWT 강의
언제 db에 값을 넣었나요?
언제 db에 값을 넣었나요? 강의중에 넣은 영상을 본적이 없었던 것 같아서요
-
해결됨호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
인터셉터 활용?
안녕하세요 호돌맨님!JWT 관련 강의에서 ArgumentResolver를 활용해 토큰 검증을 하고 사용자 정보를 추출해 반환하셨는데, 만약 프로젝트를 진행할 때 로그인을 해야 모든 URL에 접근할 수 있다고 한다면 아래 코드처럼 인터셉터에서 토큰 검증을 하고 ArgumentResolver에선 별다른 검증 없이 subject만 추출해서 반환해도 문제가 없을까요? 혹시 제가 접근 자체를 잘못하고 있다면 알려주시면 감사하겠습니다@Slf4j @RequiredArgsConstructor public class LoginCheckInterceptor implements HandlerInterceptor { private final JwtService jwtService; @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String requestURI = request.getRequestURI(); log.info("인증 체크 인터셉터 실행 {}", requestURI); String accessToken = request.getHeader("Authorization"); jwtService.validateAccessToken(accessToken); try { jwtService.getSubject(accessToken); } catch (JwtException e) { throw new Unauthorized(); } return true; } } @RequiredArgsConstructor public class JwtArgumentResolver implements HandlerMethodArgumentResolver { private final JwtService jwtService; @Override public boolean supportsParameter(MethodParameter parameter) { boolean hasLoginAnnotation = parameter.hasParameterAnnotation(Login.class); boolean hasLoginType = LoginUser.class.isAssignableFrom(parameter.getParameterType()); return hasLoginAnnotation && hasLoginType; } @Override public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) { String accessToken = webRequest.getHeader("Authorization"); Long userId = jwtService.getSubject(accessToken); log.info("userId = {}", userId); return new LoginUser(userId); } }
-
미해결스프링 프레임워크는 내 손에 [스프1탄]
41강 아이디 중복확인 Ajax 질문이 있습니다
안녕하세요 선생님41강 아이디 중복확인 섹션에서 Interface인 MemberMapper.java 에서public Member registerCheck(String memID);위처럼 선언해주었고,MemberMapper.xml 에서<select id="registerCheck" resultType="srv.ges.entity.Member">SELECT * FROM mem_tbl WHERE memID = #{memID} </select>위처럼 select문에 resultType만 작성하셨는데,'memID'를 Parameter로 넘기니 ParameterType도 작성해야 하는 것 아닌가요?
-
미해결스프링 시큐리티
userDetailService
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.userDetailService를 강의에서 만들지도 않았는데 의존주입하는건 처음보네요; 깃허브 소스에도 없구요. 어떻게 구현하라는 뜻인가요.진짜 환불하고싶습니다. 내용도 너무 어렵게 설명하구요.
-
미해결스프링 시큐리티
UserDetailService
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. UserDetailService를 해당강의에서 만드신적도 없는데 의존주입을 하시네요? 깃허브 소스에도 없고;; 도대체 어떻게 이해하란 말씀이십니까.. 그리고 내용도 너무 어려워서 환불하고 싶어죽겠네요 하아 강의자료를 왜 다운받아서.. 여튼 라이브코딩도 아니고 참.. UserDetailService를 보여주셔야할것같네요;
-
미해결스프링 시큐리티
userDetailService를 작성한 적이 없는데;
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 강사님.. 너무 강의 못하시는거아닙니까.. userDetailService를 만든적도 없고 깃허브관련 소스들어가니까 있지도않은데;; 진짜 환불하고싶습니다.. 따라가기에 너무 어렵구요;;
-
미해결스프링 시큐리티
오류 질문입니다.
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요.이런 오류가 뜨는데,, 어떻게 해결해야하나요..?
-
미해결스프링 시큐리티
spring boot 2.7버전에서 customUserDetailsServce 등록에 관해 질문드립니다
안녕하세요 선생님, 강의에서는 customUserDetailsServce를 configure메서드를 오버라이드 해서 적용하고 있는데요, 새로운 버전에서는 어떻게 적용을 명시적으로 하는지 잘 모르겠고 지정을 하지 않아도 잘 동작하더라구요.제가 찾아봤을 때는 @Bean CustomUserDetailsService customUserDetailsService() { return new CustomUserDetailsService(); }이런식으로 Bean으로 등록하면 된다는데, https://docs.spring.io/spring-security/reference/servlet/authentication/passwords/user-details-service.htmlSecurityconfig파일에서 Bean으로 등록하지 않아도 자동으로 customUserDetailsService가 동작하더라구요 그래서 제가 나름대로 결론 내린 것은 userDetailsService를 구현하는, 빈으로 등록된 커스텀 userDetailsService가 있다면 폼 로그인 방식에서 자동으로 커스텀 userDetailsService를 사용한다. userDetailsService를 구현하는 여러 커스텀 userDetailsService가 잇으면 configuration에서 명시적으로 지정해주어야 한다. 라고 이해했는데, 혹시 제가 잘못 생각한 부분이 있다면 알려주시면 감사하겠습니다.
-
미해결호돌맨의 요절복통 개발쇼 (SpringBoot, Vue.JS, AWS)
Spring boot + Vue 배포
당연히 구글링 해보셨져? 원하는 결과를 못찾으셨나요? 어떤 검색어를 입력했는지 알려주세요.문제가 발생한 코드(프로젝트)를 Github에 올리시고 링크를 알려주세요.안녕하세요! 강의 보면서 저만의 프로젝트를 열심히 만들어보고 있습니다.다름이 아니라 호돌맨님 프로젝트와 비슷하게 프로젝트 폴더 아래 front와 src (Springboot)가 따로 있는 상황이어서 인터넷을 찾아보며 vue build 결과물 (dist 폴더)를 src/main/resources/static/ 에 넣고 배포하는 식으로 진행해보았습니다.위 처럼 했을 때는 5173 => 8080 이 서로 통신하는게 아닌게 되버린 것인지 Vue에서 작성했던 코드들이 정상적으로 작동하지 않아 문제를 겪고있습니다.그 외에도 다른 글들을 참고하면서 build를 해보면 build 과정에서 오류가 발생하는 상황입니다.제대로 동작하게 배포를 하고 싶은데,vue 부분을 따로 배포하는 것 말고는 방법이 없을까요?좀 오랫동안 삽질하게 되어 질문드립니다... 방향이나 참고할만한 내용이 있을까요...?git - https://github.com/ppusda/NyangMunity
-
미해결스프링 시큐리티
EntryPoint와 Handler의 차이가 궁금합니다.
안녕하세요 인증이나 인가 예외가 터졌을 때 인증 예외의 경우에는 AuthenticationEntryPoint가 리다이렉트 등의 로직을 수행하고 AccessDeniedException의 경우에는 AccessDeniedHandler가 동작하는 것으로 이해하였습니다. 근데 둘다 결국 예외가 발생했을 때 처리를 하는 역할인데 굳이 하나는 엔트리포인트라는 객체를, 다른 하나는 핸들러 객체를 사용하는지 모르겠습니다. 저는 둘 다 엔트리포인트나 혹은 핸들러라고 할 수 있는 거 아닌가 생각이 들었는데 둘이 무슨 차이가 있는지 잘 모르겠어서요 ㅠㅠ 알려주시면 감사하겠습니다.
-
미해결스프링 시큐리티
CSRF 토큰 에러
2023-05-27 23:50:24.371 ERROR 20044 --- [nio-8090-exec-2] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8090-exec-2] Exception processing template "home": An error happened during template parsing (template: "class path resource [templates/home.html]") org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/home.html]") at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:366) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1406) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1150) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.27.jar:5.3.27] at javax.servlet.http.HttpServlet.service(HttpServlet.java:529) ~[tomcat-embed-core-9.0.74.jar:4.0.FR] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.27.jar:5.3.27] at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.74.jar:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) ~[spring-security-web-5.7.8.jar:5.7.8] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na] Caused by: org.attoparser.ParseException: Exception evaluating SpringEL expression: "_csrf.token" (template: "home" - line 5, col 31) at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parse(MarkupParser.java:257) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] ... 58 common frames omitted Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Exception evaluating SpringEL expression: "_csrf.token" (template: "home" - line 5, col 31) at org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:292) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:144) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.ProcessorTemplateHandler.handleStandaloneElement(ProcessorTemplateHandler.java:918) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleStandaloneElementEnd(TemplateHandlerAdapterMarkupHandler.java:260) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleStandaloneElementEnd(InlinedOutputExpressionMarkupHandler.java:256) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleStandaloneElementEnd(OutputExpressionInlinePreProcessorHandler.java:169) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleStandaloneElementEnd(InlinedOutputExpressionMarkupHandler.java:104) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.attoparser.HtmlElement.handleStandaloneElementEnd(HtmlElement.java:79) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.HtmlMarkupHandler.handleStandaloneElementEnd(HtmlMarkupHandler.java:241) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupEventProcessorHandler.handleStandaloneElementEnd(MarkupEventProcessorHandler.java:327) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.ParsingElementMarkupUtil.parseStandaloneElement(ParsingElementMarkupUtil.java:96) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:706) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] ... 60 common frames omitted Caused by: org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'token' cannot be found on null at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:219) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:106) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:53) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:412) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:93) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:114) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:338) ~[spring-expression-5.3.27.jar:5.3.27] at org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:265) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] ... 79 common frames omitted 2023-05-27 23:50:24.375 ERROR 20044 --- [nio-8090-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/home.html]")] with root cause org.springframework.expression.spel.SpelEvaluationException: EL1007E: Property or field 'token' cannot be found on null at org.springframework.expression.spel.ast.PropertyOrFieldReference.readProperty(PropertyOrFieldReference.java:219) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:106) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference.access$000(PropertyOrFieldReference.java:53) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.PropertyOrFieldReference$AccessorLValue.getValue(PropertyOrFieldReference.java:412) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:93) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:114) ~[spring-expression-5.3.27.jar:5.3.27] at org.springframework.expression.spel.standard.SpelExpression.getValue(SpelExpression.java:338) ~[spring-expression-5.3.27.jar:5.3.27] at org.thymeleaf.spring5.expression.SPELVariableExpressionEvaluator.evaluate(SPELVariableExpressionEvaluator.java:265) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:166) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.processor.AbstractStandardExpressionAttributeTagProcessor.doProcess(AbstractStandardExpressionAttributeTagProcessor.java:144) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.ProcessorTemplateHandler.handleStandaloneElement(ProcessorTemplateHandler.java:918) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleStandaloneElementEnd(TemplateHandlerAdapterMarkupHandler.java:260) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleStandaloneElementEnd(InlinedOutputExpressionMarkupHandler.java:256) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleStandaloneElementEnd(OutputExpressionInlinePreProcessorHandler.java:169) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleStandaloneElementEnd(InlinedOutputExpressionMarkupHandler.java:104) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.attoparser.HtmlElement.handleStandaloneElementEnd(HtmlElement.java:79) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.HtmlMarkupHandler.handleStandaloneElementEnd(HtmlMarkupHandler.java:241) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupEventProcessorHandler.handleStandaloneElementEnd(MarkupEventProcessorHandler.java:327) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.ParsingElementMarkupUtil.parseStandaloneElement(ParsingElementMarkupUtil.java:96) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:706) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.attoparser.MarkupParser.parse(MarkupParser.java:257) ~[attoparser-2.0.5.RELEASE.jar:2.0.5.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:366) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:190) ~[thymeleaf-spring5-3.0.15.RELEASE.jar:3.0.15.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1406) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1150) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1089) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.27.jar:5.3.27] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.27.jar:5.3.27] at javax.servlet.http.HttpServlet.service(HttpServlet.java:529) ~[tomcat-embed-core-9.0.74.jar:4.0.FR] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.27.jar:5.3.27] at javax.servlet.http.HttpServlet.service(HttpServlet.java:623) ~[tomcat-embed-core-9.0.74.jar:4.0.FR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) ~[tomcat-embed-websocket-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:223) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:217) ~[spring-security-web-5.7.8.jar:5.7.8] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:186) ~[spring-security-web-5.7.8.jar:5.7.8] at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.27.jar:5.3.27] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.27.jar:5.3.27] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.74.jar:9.0.74] at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na] 위와 같은 에러가 계속터집니다..강의 소스와 다른점 을 못찾겠어요...https://github.com/whitewise95/springSecurity마스터 브랜치입니다..EL1007E: Property or field 'token'<meta id="_csrf" name="_csrf" th:content="${_csrf.token}"/> <meta id="_csrf_header" name="_csrf_header" th:content="${_csrf.headerName}"/>위 코드를 제거하면 됩니다...
-
미해결스프링 시큐리티
antMatcher 적용 시 formLogin이 작동하지 않습니다.ㅠ
강사님 안녕하세요.! http .antMatcher("/ko/**") .authorizeRequests() .antMatchers("/ko/partner/progress/**","/ko/partner/tech/**").access("hasRole('ADMIN') or hasRole('MEMBER')") .anyRequest().permitAll() .and() .formLogin() // .httpBasic()antMatcher를 사용하게 되니formLogin() 이 적용되지 않습니다.ㅠㅠ.httpBasic()만 적용이 되네요.formLogin()이 작동할 수 있는 방법 좀 부탁드립니다.ㅠ.ㅠ
-
미해결스프링 시큐리티
다중 로그인시 로그인 인증이 되지 않습니다.ㅠ 조언 부탁드립니다.
안녕하세요. 강사님!시큐리티 강의 잘 보고 있습니다. 강의를 보면서 프로젝트를 진행하고 있는데 국문 -> 국문 LOGIN 화면영문 -> 영문 LOGIN 화면으로 이동하게 하려고 하려고 WebSecurityConfigurerAdapter를 상속받은 class를 2개 만들어 Order(0) , Order(1)로 진행했는데해당 login 페이지에서 아이디/비번을 입력하면 인증이 되지 않고 .loginProcessingUrl("/login-ko") 해당 페이지로 넘어갑니다.왜 단일로 할때는 문제 없었는데 다중으로 했을 때 왜 이런 문제가 발생했을까요?ㅠㅠ조언 부탁드립니다.package com.posco.hyrex.infra.config; import com.posco.hyrex.modules.front.account.provider.AccountAuthenticationProvider; import javassist.tools.web.Webserver; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.security.servlet.PathRequest; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.core.annotation.Order; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.builders.WebSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; import org.springframework.security.crypto.factory.PasswordEncoderFactories; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.security.web.authentication.AuthenticationSuccessHandler; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import javax.servlet.http.HttpServletResponse; @Slf4j @Configuration @EnableWebSecurity @RequiredArgsConstructor @Order(0) public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private AuthenticationSuccessHandler authenticationSuccessHandler; @Autowired private AuthenticationFailureHandler authenticationFailureHandler; @Override protected void configure(AuthenticationManagerBuilder auth) throws Exception { auth.authenticationProvider(accountAuthenticationProvider()); } @Bean public AuthenticationProvider accountAuthenticationProvider() { return new AccountAuthenticationProvider(); } @Bean public PasswordEncoder passwordEncoder() { return PasswordEncoderFactories.createDelegatingPasswordEncoder(); } @Bean public SecurityContextLogoutHandler securityContextLogoutHandler() { return new SecurityContextLogoutHandler(); } @Override protected void configure(final HttpSecurity http) throws Exception { http.csrf().disable(); http.cors().disable(); http .antMatcher("/ko/partner/**") .authorizeRequests() .mvcMatchers("/ko/partner/summary**","/ko/login**").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/ko/login") .loginProcessingUrl("/login-ko") .defaultSuccessUrl("/ko/partner/summary") .successHandler(authenticationSuccessHandler) .failureHandler(authenticationFailureHandler) .permitAll() ; } @Override public void configure(WebSecurity web) throws Exception { web.ignoring() .mvcMatchers("/error/**","/assets/**") .requestMatchers(PathRequest.toStaticResources().atCommonLocations()); } } @Configuration @Order(1) class SecurityConfig2 extends WebSecurityConfigurerAdapter{ @Autowired private AuthenticationSuccessHandler authenticationSuccessHandler; @Autowired private AuthenticationFailureHandler authenticationFailureHandler; @Override public void configure(HttpSecurity http) throws Exception { http .antMatcher("/en/partner/**") .authorizeRequests() .mvcMatchers("/en/partner/summary**","/en/login**").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/en/login") .loginProcessingUrl("/login-en") .defaultSuccessUrl("/en/partner/summary") .successHandler(authenticationSuccessHandler) .failureHandler(authenticationFailureHandler) .permitAll(); } } <!-- 본문 시작 --> <main class="main main-sub-top"> <section class="login-section"> <div class="column"> <div class="background"></div> </div> <div class="column"> <form th:action="@{/login-ko}" method="post"> <div class="login-form"> <div class="row"> <div class="col"> <div class="logo"> <img src="/assets/images/logo-dark.svg" alt=""> </div> <p class="text">서비스를 이용하기 위해 로그인 해주세요.</p> </div> </div> <div class="row"> <div class="col"> <div class="form-floating-icon"> <i class="icon icon-login"></i> <input type="text" id="floatingInput" name="username" class="form-control" th:classappend="${error == 'true'}? is-invalid" placeholder="아이디"> <label for="floatingInput">아이디</label> <!-- 유효성 체크 --> <!-- <div class="invalid-feedback">아이디가 일치하지 않습니다.</div>--> </div> </div> </div> <div class="row"> <div class="col"> <div class="form-floating-icon"> <i class="icon icon-password"></i> <input type="password" id="floatingInput2" name="password" class="form-control" th:classappend="${error == 'true'}? is-invalid" placeholder="비밀번호"> <label for="floatingInput2">비밀번호</label> <!-- 유효성 체크 --> <div th:if="${param.error}" class="invalid-feedback" th:text="${exception}">패스워드가 일치하지 않습니다.</div> </div> </div> </div> <div class="row"> <div class="col"> <button class="button button-primary" type="submit">로그인</button> </div> </div> <div class="row"> <div class="col"> <div class="info"> <p><span class="color-primary">*</span> 아이디/비밀번호를 잊어버리신 경우 아래의 연락처로 문의해 주세요.</p> <ul> <li>E-MAIL : hyrex@posco.com</li> <li>TEL : 02-1234-1234</li> </ul> </div> </div> </div> </div> </form> </div> </section> </main> ----------------------------------------------------------- @Override protected void configure(final HttpSecurity http) throws Exception { http.csrf().disable(); http.cors().disable(); http .antMatcher("/ko/partner/**") .authorizeRequests() .mvcMatchers("/ko/partner/summary**","/ko/login**").permitAll() .anyRequest().authenticated() .and() .formLogin() // .loginPage("/ko/login") // .defaultSuccessUrl("/ko/partner/summary") // .successHandler(authenticationSuccessHandler) // .failureHandler(authenticationFailureHandler) // .permitAll() ; }위와 같이 loginPage 경로에 주석을 걸고/ko/partner/test 경로로 접속했을때기본 /login 페이지로 가는 부분에서도 에러가 발생합니다.ㅠ먼가 설정을 잘못한 부분이 있을까요?
-
미해결스프링부트 시큐리티 & JWT 강의
어떻게 자동으로 home으로 넘어가지나요?
로그인후 어떻게 바로 home주소로 넘어가나요?저는 로그인후 home을 직접쳐야 넘어가지던데
-
해결됨스프링 시큐리티
5.7 이후로 Deprecated 되었습니다.
이제, 'SecurityFilterChain'의 각 요청에 대해 별도의 'SecurityContext'에 인스턴스가 존재한다고 합니다.이를 통해 'Spring Security'는 'SecurityContext'의 생명주기를 'HTTP Request'와 동일하게 관리할 수 있게 되었다고 합니다.즉, 이전 방식처럼 'SecurityContextPersistenceFilter'와 같이 'SecurityContext'를 세션에 저장하고 불러오는 별도의 필터가 불필요해져서 지금은 Deprecated 되었고, SecurityContext'의 저장 위치를 'SecurityContextRepository' 인터페이스 구현체인 'HttpSessionSecurityContextRepository'가 담당하게 되면서 더욱 유연해졌다고 하는데 맞을까요?
-
미해결스프링 시큐리티
NullpointerException이 발생합니다
회원 가입 시 DB에 정상적으로 회원 정보가 생성은 되는데 이 후 로그인 시도 시 CustomAuthenticationProvider에서 userDetailsService.loadUserByUsername(username); 수행 시 Null을 반환합니다. java.lang.NullPointerException: Cannot invoke "io.security.corespringsecurity.security.service.CustomUserDetailsService.loadUserByUsername(String)" because "this.userDetailsService" is null at io.security.corespringsecurity.security.provider.CustomAuthenticationProvider.authenticate(CustomAuthenticationProvider.java:26) ~[classes/:na]
-
해결됨스프링 시큐리티
Ajax로그인 - loginProcessingUrl("/api/login") 관련 질문있습니다
안녕하세요 강사님. 강의를 따라 실습하는데 강사님과 다르게 동작합니다. 이유를 못찾아서 도움이 필요합니다 ㅠㅠ7) Ajax로그인 구현 & CSRF설정 15:00 부분강의에서는 브라우저에서 window.location = '/api/login?error=true&exception=' + xhr.responseJSON.message;호출이후 서버에서 로그인 컨트롤러가 호출되는데,저는 window.location 이후 AjaxLoginAuthenticationEntryPoint 가 다시 호출됩니다.그래서 AjaxSecurityConfig 클래스에 .antMatchers("/api/login/**").permitAll() 를 추가해서 테스트 해보았더니 컨트롤러가 호출 되었습니다.왜 강사님과 다르게 저는 window.location 이후 AjaxLoginAuthenticationEntryPoint가 왜 다시 호출되는지 알 수 있을까요?https://github.com/GwanUk/basicsecurity.git
-
미해결스프링부트 시큐리티 & JWT 강의
안녕하세요 질문이 있습니다.
안녕하세요. 좋은 강의 만들어주셔서 감사합니다.강의 마지막 내용 중, A가 B에게 보낼 내용을 B의 공개키로 잠근 후 그 후에 A의 비밀키로 잠그면 B는 A의 공개키로 연 후에, B의 비밀키로 해당 문서를 복호화 하는 것까지는 이해했습니다. 여기서 궁금한 게 하나 생기는데, A의 공개키는 누구나 다운받을 수 있으니 해커도 다운받을 수 있으므로 A의 공개키로 해커가 복호화한 후 데이터를 날려버리고 새로운 데이터를 B에게 보낼 수 도 있는게 아닌가요?? 살짝 전의 내용에서 해커가 데이터를 가로채 데이터를 날려 새로운 데이터를 보낼 수 있다다는 것을 보고 궁금증이 생겼습니다.
-
해결됨스프링 시큐리티
매니저 권한으로 로그인하지 않아도 매니저 권한자원에 접근이 가능한데 이유를 모르겠습니다 ㅠㅠ
매니저 권한으로 로그인하지 않아도 매니저 권한자원에 접근이 가능한데 이유를 모르겠습니다 ㅠㅠhttps://github.com/whitewise95/springSecurity 입니다 ㅠㅠ