묻고 답해요
164만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
미해결스프링 시큐리티
다중 로그인시 로그인 인증이 되지 않습니다.ㅠ 조언 부탁드립니다.
안녕하세요. 강사님!시큐리티 강의 잘 보고 있습니다. 강의를 보면서 프로젝트를 진행하고 있는데 국문 -> 국문 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 페이지로 가는 부분에서도 에러가 발생합니다.ㅠ먼가 설정을 잘못한 부분이 있을까요?
-
해결됨타입스크립트 입문 - 기초부터 실전까지
[참고] 섹션1-3 [자바스크립트에 타입이 있을 때의 첫 번째 장점] - why-ts undefined
섹션1-3 강의명 [자바스크립트에 타입이 있을 때의 첫 번째 장점] 중 why-ts의 app.js에서 axios.get(url)의 response 를 User type으로 정의하였습니다. Promise<User>이때, response가 아닌 response.data가 User type이므로 자동완성을 따라가면 undefined 문제가 발생합니다.이미 많은 질문이 나왔고 답변으로도 말씀하셨듯 필요성을 인지하기엔 충분하므로 수강하시는 분들은 단순 참고 바랍니다.🙏
-
미해결스프링 핵심 원리 - 기본편
MemberServiceTest에서 MembeService를 AppConfig에서 꺼내기 애매한 이유
24:18 쯤 MemberServiceTest.java 코드 작성 중에MembeService를 AppConfig에서 꺼내기 애매하다고 하셨는데 그 이유가 궁금합니다!@BeforeEach로 각 테스트마다 AppConfig에서 MembeService를 생성해주는게 왜 좋은지 질문드립니다!
-
미해결[코드팩토리] [초급] Flutter 3.0 앱 개발 - 10개의 프로젝트로 오늘 초보 탈출!
Geolocator.distanceBetween 값이 맞지 않는데 이유를 모르겠네요
위와 같이 코드 작성했는데, Geolocator.distanceBetween 함수에서 돌아오는 값이 너무 크네요... 도저히 모르겠습니다 알려주세요~
-
미해결HTML+CSS+JS 포트폴리오 실전 퍼블리싱(시즌1)
sns 아이콘 애니메이션
안녕하세요 선생님!정말 재밌고 유익하게 강의듣고있습니다 ㅎㅎ해당 강의를 듣다가 아이콘부분이 아래에가있어서 hover시 보여주기 위해position: relative를 주셨는데z-index를 주는것은 왜 안될까요??될까 싶어서 해봤는데 먹히지 않아서 여쭤봅니다
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 백엔드 코스
코드 오류 (06-03)
06-03 클래스 전략 패턴수업에서 선생님과 코드를 똑같이 입력했는데 오류(공중 몬스터 not defined)가 납니다. 어떤 부분이 문제일까요? class 공중부품 { run = () => { console.log("날아서 도망가자!!"); } } class 지상부품 { run = () => { console.log("뛰어서 도망가자!!"); } } class Monster { power = 10; 부품; constructor(qqq){ this.부품 = qqq; } attack = () => { console.log("공격하자!!"); console.log("내 공격력은" + this.power + "야!!!"); }; run = () => { this.부품.run();class 공중부품 { run = () => { console.log("날아서 도망가자!!"); } } class 지상부품 { run = () => { console.log("뛰어서 도망가자!!"); } } class Monster { power = 10; 부품; constructor(qqq){ this.부품 = qqq; } attack = () => { console.log("공격하자!!"); console.log("내 공격력은" + this.power + "야!! }; } const mymonster1 = new Monster(new 공중부품()); mymonster1.attack(); mymonster1.run(); const mymonster2 = new Monster(new 지상부품()); mymonster2.attack(); mymonster2.run();
-
해결됨하루만에 배우는 ChatGPT API
sitemap 추가하기 편에서요
3:22 이때 어디다가 어떤 명령어를 쳐서 rss 랑 stie map 이 배포가 잘됐나 확인하는건가요? 주소창 맨 끝에 .app/rss.xml 인가요?
-
미해결홍정모의 따라하며 배우는 C언어
8.9 강의 파일 위치에 대해 여쭙니다.
vcxproj도 있는 상황에서 파일 리드에 실패합니다. 이럴 경우 어떻게 해야하나요?
-
해결됨실전! Querydsl
select절 서브쿼리 컬럼으로 where절에 조선으로 넣을 수 있나요??
select절 서브쿼리를 이용해서 where절 에 조건컬럼으로 파라미터를 받을 수 있나요??select(subQuery) as sub,다른 컬럼들from mainQuerywhere sub = :param;위와같은 식으로 서브쿼리 별칭으로 조건검색이 가능한가요?? 가능하면 코드로도 알려주세요감사합니다
-
미해결Node.js로 데이터베이스 다루고 웹 애플리케이션 만들기
프로젝트 세팅
프로젝트 세팅은 어떻게 하는지 언급이 따로 안된 것 같은데 뒤에 설명이 나올까요?orientjs 를 프로젝트에 적용하는 파트에서 프로젝트 세팅이 없었다는 것을 깨달았습니다.
-
해결됨Windows 소켓 프로그래밍 입문에서 고성능 서버까지!
tcp 통신 관련하여 질문드립니다
안녕하세요 선생님~tcp 관련해서 질문을 드리고 싶습니다. ^^tcp 버퍼라는게 따로 존재하나요? 아니면 소켓 버퍼가 곧 tcp 버퍼인가요?segmentation된 데이터는 어디서 조립되나요? 만약 소켓 버퍼에서 조립된다면 recv했을 때 덜 조립된 데이터를 받거나 하진 않는지 궁금합니다.관련 책에서 본 내용인데요, 송신 버퍼에 1바이트의 여유만 있어도 tcp는 send가 가능하다는데 이러면 데이터가 다른 관련없는 데이터와 섞여서 송신되거나 하지는 않나요?다른건 안그러는데 이상하게 네트워크 쪽만 공부하면 자꾸 깊게 파고들려고 하네요. ;;호기심을 적당히 가져야 진도를 빠르게 뺄텐데... 그래도 좋게 생각해야겠죠? ㅎㅎ항상 좋은 강의 감사드립니다~^^
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
Promise의 resolve
왼쪽이 어떻게 오른쪽과 같을 수 있나요? resolve가 콜백함수라서 그런 건가요? 맞다면 좀 더 자세하게 설명해주세요.
-
미해결[웹 개발 풀스택 코스] 순수 자바스크립트 기초에서 실무까지
POST요청 undefined
63_dom_crud_multiple.html 강좌에서 POST를 통해 유저가 입력한 값을 테이블에 넣어주려 하는데 undefined값이 전달되네용.. 왜 이렇게 전달될까요..?POST부분의 코드입니다
-
미해결Next.js 시작하기(feat. 지도 서비스 개발)
실무에서 init 커밋부터 완성까지 프로젝트 단독 전담개발은 몇 년차 급이 하는건가요?
삭제된 글입니다
-
해결됨Flutter 앱 개발 기초
페이지간 Route
안녕하세요, 강의 잘 듣고 있습니다.페이지가 별로 없으면 main.dart안에 여러페이지가 있어도 문제는 없을꺼 같은데,많아질 경우, 다른 dart파일에 페이지를 추가로 만들고페이지간 이동을 할 수 있을까요.방법이 궁금합니다. 감사합니다.https://open.kakao.com/me/devstory로 문의주시면 더 빠르게 답변 받으실 수 있어요 :)
-
해결됨한 입 크기로 잘라 먹는 리액트(React.js) : 기초부터 실전까지
npm randomcolor
해당 화면 3번째 줄에서 randomColor() 말고 randomColor라고 쓰면 왜 안되는 건가요?
-
해결됨곰책으로 쉽게 배우는 최소한의 운영체제론
가상메모리 용량 질문
가상 메모리가ram + hdd 면 가상 메모리의 용량은ram + hdd 이하로 제한되나요?RAM 4기가 / HDD 32기가라면 총 가상메모리의 공간은 36기가 이하라고 생각하면 될까요?
-
미해결이득우의 언리얼 프로그래밍 Part1 - 언리얼 C++의 이해
UTF-8 형식 저장하기 연구 적용하기
여러가지 실험 결과 언리얼 C++ 프로젝트를 만들때 파일을 OS의 기본 인코딩을 따라가기 때문에 OS 인코딩 방식을 바꾸면 모든 파일이 자동적으로 UTF-8 방식으로 저장된다는 걸 깨달았습니다. 윈도우 11 기준으로 다음 단계를 거치면 UTF-8로 일일이 파일을 고처 수정하지 않아도 됩니다.윈도우 시작 버튼 > 설정 창 열기"시간 및 언어"으로 이동합니다.시스템Beta: 세계 언어 지원을 위한 Unicode UTF-8 사용 체크 후, 확인이제 윈도우를 재부팅하고 C++ 프로젝트를 생성하면 모든 파일이 UTF-8로 저장됩니다. 아무도 모르는 꿀팁인거 같아서 올립니다.윈도우 10 버전:https://whatsupkorea.tistory.com/376
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
질투심이 ~~일때
로 보는 건 그런가 보다 싶은데왜 질투심으로 보석을 나눠야 하는지 이해가 안 갑니다
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
회원가입 과제 코드
회원가입 과제는 따로 정답 코드가 없는건가요?