소셜로그인 강의까지 봤는데요, 강의에 있는 프로세스는 소셜로그인시 이메일을 가져와서 DB에 저장이 되어있지 않으면 카카오이메일로 회원가입을 시키고, DB에 저장이 되어있으면 비밀번호 없이 해당 계정으로 로그인이 되게끔 만드는 프로세스로 이해 했습니다. 그런데, 기존에 회원가입을 하지 않은 사람이 소셜로그인을 할 때 이미 기존에 가입되어 있는 이메일이 있다면 다른사람 계정을 비밀번호 없이 로그인 할 수 있게되는게 지금 구현한 상황에서는 맞는거죠? ex) 기존에 회원가입한 'A' 의 이메일이 test@AAA.com 일 때 신규 유입된 사람 'B'의 카카오계정 이메일이 test@AAA.com 인 경우 위와 같은 경우를 방지하려면 소셜로그인시(최초로그인) 회원가입을 시킬 때 이메일 중복체크를 하고 중복되어있다면 다른 이메일 사용을 권유 해야되는식으로 처리를 해야 하는건가요?
위 코드는 수업중 진행하신 MemberServiceImpl.java 파일의 getEmailFromKakaoAccessToken 메소드의 일부입니다. 저기에서 마지막에 bodyMap 을 로그로 확인하는 부분이 있는데 위와 같이 nickname 을 보면 인코딩이 깨져서 나옵니다. 저 nickname 을 확인하려면 어떻게 해야하나요?
카카오 토큰 받기 이후로 많은 오류가 한번에 떠서 질문 드립니다! 부트 서버에서도 member.service, impl에 콘솔 찍은것도 에러로 인해 안뜹니다 상황마다 500오류 400오류 grant value 오류 등이 계속 뜹니다 ㅜㅜ 부트 https://github.com/hyeonbin03/IntelliJHub 일단 부트 코드는 선생님 주셨던 파일 참고해서 Member Modify 기능까지 작성 완료 된 상태입니다 리엑트 https://github.com/hyeonbin03/WebStromHub 깃 주소 남겨드겠습니다 ㅠㅠ
jwt 10분 유효기간 끝난 상황에서 jwtAxios를 이용해서 products 를 호출하면 JWTCheckFilter를 걸쳐서 validateToken 메서드를 호출하고 거기서 Exired Exception 이 납니다. accessToken 이 유효시간(10분)이 경과하였으면 refreshToken 으로 교체되는 걸로 강의내용을 인지했었는데요. 제가 어디서 놓친건지 잘 모르겠네요 ㅠ react쪽에서 beforeReq 쪽에서 결국 expired 처리가되고 brforeRes 에서 뭔가 유효기간이 끝났으면 /api/member/refresh 를 호출해야될 것 같은데 예제 소스 잘 따라한거 filter에서 먼저 유효기간이 만료되어 exception 부터 호출되어 더이상 진행이 안되네요. 어디가 정확히 문제인지 모르겠네요. jwtUtil.js 는 제공해주신 소스는 오타가 있을까봐 동일하게 ctrl+c , v 도 했습니다. JWTUtil.java 일부분 public static Map<String, Object> validateToken(String token) { Map<String, Object> claim = null; try { SecretKey key = Keys.hmacShaKeyFor(JWTUtil.key.getBytes("UTF-8")); claim = Jwts.parserBuilder() .setSigningKey(key) .build() .parseClaimsJws(token) // 파싱 및 검증, 실패 시 에러 .getBody(); } catch (MalformedJwtException malformedJwtException) { throw new CustomJWTException("MalFormed"); } catch (ExpiredJwtException expiredJwtException) { throw new CustomJWTException("Expired"); } catch (InvalidClaimException invalidClaimException) { throw new CustomJWTException("Invalid"); } catch (JwtException jwtException) { throw new CustomJWTException("JWTError"); } catch (Exception e) { throw new CustomJWTException("Error"); } return claim; }
모달창이 안떠서 settimeout으로 처리 하니 Modal에 result 값이 true로 적용됩니다 코드는 깃으로 올리겠습니다 선생님 강의에 올라와있는 ch06 파일 코드 넣어서 해봐도 모달창이 안뜨네요 ㅜㅜ https://github.com/hyeonbin03/webstromhub
loadUserByUsername 메서드에서 username 으로 조회잘되고 조회된 MemberDto는 log 출력도 잘되는데 다음 단계에서 "Encoded password does not look like BCrypt" 라는 warn 과 함꼐 "Failed to process authentication request" 로 자격증명에 실패했다고 합니다. DB의 패스워드는 암호화 되어 잘 저장된거 확인됩니다 제가 무언가를 잘못 작성한건지 파라미터로 보낸 password 는 어디서 encode해야 하는건지 아니면 다른 문제가 있는건가요?
안녕하세요, 강의 잘 보고 있습니다. 이번에 JWT 관련 기능을 구현함에 있어 참고차 보게되었는데요. 시큐리티가 인터페이스화가 많이 되어있다보니 동일한 기능임에도 구현하는 사람마다 어느 필터에서 인증/인가를 구현하는 지가 차이가 있는 것 같습니다. 섹션 3 버전2 소스 기준으로 JwtAuthorizationFilter 의 경우 BasicAuthenticationFilter를 확장하여 사용하고 JwtAuthenticationFilter의 경우 UsernamePasswordAuthenticationFilter 를 확장하여 사용하고, 필터에 등록되어 있습니다. 위 2가지 필터는 공식 문서 참고에 의하면 BasicAuthenticationFilter 는 HTTP 헤더에서 토큰을 추출하여 간단히 인증을 하는 용도로, UsernamePasswordAuthenticationFilter는 폼 기반의 로그인을 처리한다고 나와 있습니다. 만약 그렇다면, 폼 로그인 없이 JWT 토큰 만으로는 BasicAuthenticationFilter를 확장하는 JwtAuthorizationFilter만 존재해도 인증 과정 상 크게 문제는 없어보이는데요. (권한 체크는 별도로 할거라 인증 과정에 넣지 않으려고 합니다.) 어떤 분은 토큰 체크하는 부분을 GenericFilterBean 또는 OncePerRequestFilter 로 구현하시는 분들도 존재하더라구요. 단순히 로그인 컨트롤러에서 JWT 토큰을 발급하고 이후 요청 필터에서 토큰 체크 및 리프레시 토큰 체크 등의 인증 처리를 한다면 어떤 필터를 구현하여 등록하는 걸 추천하시는지 개인적으로 궁금합니다. 감사합니다.
프로젝트를 설정하고 되다가 다시 키니까 안되서 문의드립니다. 제가 java 버전이 3개 정도 설치되어 있는 데 작업할 때 17로 수정해서 쓰고 다른 것 해야 할 때 11로 바꿔서 썼다가 오늘 17로 바꿔서 쓰는 데 자바버전이 안 먹히는 것 같아서 문의 드립니다. The supplied phased action failed with an exception. A problem occurred configuring root project 'mallapi'. Could not resolve all files for configuration ':classpath'. Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT. Required by: project : > org.springframework.boot:org.springframework.boot.gradle.plugin:3.1.10-SNAPSHOT:20240229.214127-20 No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT:20240229.214127-20 was found. The consumer was configured to find a library for use during runtime, compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '8.5' but: - Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '8.5') - Variant 'javadocElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 11) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '8.5') - Variant 'mavenOptionalApiElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.10-SNAPSHOT declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component for use during compile-time, compatible with Java 17 and the consumer needed a component for use during runtime, compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '8.5') - Variant 'mavenOptionalRuntimeElements' capability org.springframework.boot:spring-boot-gradle-plugin-maven-optional:3.1.10-SNAPSHOT declares a library for use during runtime, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '8.5') - Variant 'runtimeElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT declares a library for use during runtime, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component, compatible with Java 17 and the consumer needed a component, compatible with Java 11 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '8.5') - Variant 'sourcesElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.1.10-SNAPSHOT declares a component for use during runtime, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 11) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '8.5')
기본적으로 터미널에 Starting the development server... 이 뜨고 페이지가 나오긴 하는데 무한 로딩이 걸립니다..그 후 로딩이 멈추면 콘솔창에 이런 오류가 발생합니다 ++기다려 보니 WebSocket connection to 'ws://localhost:3000/ws' failed: WebSocketClient @ WebSocketClient.js:13 initSocket @ socket.js:27 (anonymous) @ socket.js:51 Show 3 more frames Show less 이런 오류도 뜹니다
선생님 안녕하세요! 강의내용이랑 상관없는 질문이라 정말 죄송합니다..ㅜㅜ! 다만 궁금한게있어서 염치불구하고 질문드립니다.. 다름아니라, Nextjs에 자체적으로 서버 api가 있는걸로 알고있습니다. 그래서 Nextjs를 사용할때는 DB만 선정해서 작업하는식으로 해도된다고 알고있는데요.. 정말 인가요? 정말이겠지만.. 음 .. 옳은 방식인가요? 만약 제가말한 1번경우말고,Nextjs랑 Nestjs랑 같이 사용할경우 Nestjs용 서버폴더를 따로 만들고 사용하는게 나을까요? 회원가입 로직도 그럼 서버폴더에서 따로 할테고.. 그러면 넥스트js의 auth라이브러리를 따로 사용을 못하는걸까요?
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 1.postman에서 /login경로로 로그인 시도를 하여 성공하였는데, 로그인 성공 이후에는 어떤 경로로 이동하게 되는건가요? 만약 리액트와 협업을 하여 로그인 기능을 구현한다면 로그인 화면에서 아이디와 비밀번호를 치고 로그인을 시도해야하는데 그 경우에는 경로를 @PostMapping("/login") public void login(User user) { } 이런식으로 해야하는건가요?
jwt를 공부하던 중 JwtAuthenticationFilter에 있는 successfulAuthentication메서드에서 response.addHeader( "Authorization" , "Bearer " + jwtToken) ; 이렇게 header값에 추가를 해주었는데 postman에서 send를 해도 response의 headers쪽에 authorization라는 키값이 안보입니다... 무슨 다른 설정을 해주어야 할까요?