이거 강의 다시 찍어주시면 안되나여 인터넷 자료만 보고 따라 하기 넘 어렵 ; stackover flow 에서 뭐라는건지 잘몰겠습니다 ㅋㅋ; https://stackoverflow.com/questions/71557301/how-to-workraound-this-typeorm-error-entityrepository-is-deprecated-use-repo
signWith(SignatureAlgorithm.HS256, env.getProperty("token.secret")) jwt 버전 0.10 버전이상부터는 관련 내용이 문자열이 작다고 합니다. 혹시 0.11버전에 맞춰서 한다면 어떤 방식으로 해야합니까? 추가적으로 signWith의 deprecated 또한 해결 하는 방법에 대해 알려주시면 감사하겠습니다. => document 사이트 위치라도 알려주시면 직접찾아보겠습니다. 전체적으로 따라해봤는데 해쉬값이 작다고 하여 관련내용에 대해 이해를 하지 못해서 작성합니다.
WebSecurityConfigurerAdapter 가 이제 더 이상 지원을 하지 않는다고 하여 WebSecurityFilterChain으로 하래서 시도중인데 계속하여 401 에러가 뜹니다... @EnableWebSecurity public class SecurityConfig { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{ http .authorizeRequests() .antMatchers("api/hello").permitAll() .anyRequest().authenticated(); return http.build(); } }
- 학습 관련 질문을 남겨주세요. 상세히 작성하면 더 좋아요! - 먼저 유사한 질문이 있었는지 검색해보세요. - 서로 예의를 지키며 존중하는 문화를 만들어가요. - 잠깐! 인프런 서비스 운영 관련 문의는 1:1 문의하기를 이용해주세요. 11분 42초에 나오는 시점에 permitAll() 때문에 로그아웃 상태일때 처럼 되야되는데 login 창이 계속 나옵니다. user,manager도 403이 안나오고 login으로 갑니다..
Description: Parameter 0 of constructor in com.example.demo.service.CustomUserDetailsService required a bean of type 'com.example.demo.repository.UserRepository' that could not be found. Action: Consider defining a bean of type 'com.example.demo.repository.UserRepository' in your configuration. 구글링을 해봐도 전혀 해결되지 않아요 ㅠㅠ
저는 id => { id, user} 로 변경하니 type 에러가 발생했습니다. 그래서 (mac기준) 커맨드 + delete 함수 클릭 criteria 변수에 { id:number, user:User} 타입 추가 저장 이 방법으로 해결했습니다. 별거 아니지만 저는 엄청 헤매서 공유차 남깁니다..!
강의 잘 듣고 있습니다 감사합니다! 혹시 스프링 2.7.3 사용, 자바 11 사용 중인데 java: package io.jsonwebtoken.io does not exist import io.jsonwebtoken.*; import io.jsonwebtoken.io.Decoders; import io.jsonwebtoken.security.Keys; 요 3개를 import 하지 못합니다... java: package io.jsonwebtoken.io does not exist 오류가 뜹니다... 바쁘신데 죄송합니다.
안녕하세요 좋은 강의 잘듣고 있습니다. 다름이 아니라 강의를 듣는중에 의문이 들어 질문 드립니다. 세션과 JWT의 차이가 세션을 유지하냐 안하냐의 차이로 알고 있는데 JWT를 쓸때 authenticaion 객체가 session 영역에 저장됨 . 이라고 하셨는데, 인증정보를 세션 저장소에 저장하게 되면 결국 해당 세션을 유지하는 것 아닌가요? 차이가 없어지는 것 아닌가 싶어서 질문 남깁니다. 아, 그리고 추가로 github에 @AuthenticationPrincipal가 사용불가능이라 하셨는데 컨트롤러에서 불러와 보니까 잘 불러와지던데 제가 뭘 잘못한 걸까요?
@Component public class CustomBCryptPasswordEncoder extends BCryptPasswordEncoder { } 위 처럼 따로 BcryptPasswordEncoder를 만들어주고 컨테이너에 등록합니다! //해당 메서드의 리턴되는 오브젝트를 IoC로 등록해준다. /* @Bean() public BCryptPasswordEncoder encoder(){ return new BCryptPasswordEncoder(); } */ 그리고 위의 코드(SecurityConfig)를 저처럼 주석으로 처리해주세요! 순환 참조가 나는 이유: 1. SpringContainer에서 처음 빈으로 등록하기 위해 객체를 생성 하여 줍니다(싱클톤) 2. 그래서 SecurityConfig 객체를 생성하던 중 PrincipalOauth2UserService객체를 의존하고있네요? 그래서 PrincipalOauth2UserService를 만들어 주는데.. 3. 어라? PrincipalOauth2UserService에서도 SecurityConfig에서 빈으로 등록한 BCryptPasswordEncoder를 참조하고있네?? 4. 오잉? 스프링 :참조가 순환되넹?아아아아아악! => 오류 즉, SecurityConfig -> PrincipalOauth2UserService, 다시 PrincipalOauth2UserService->SecurityConfig 그래서 저는 SecuritiConfig -> PrincipalOauth2UserService-> CustomBCryptPasswordEncoder 로 구조를 변경하였습니다.
안녕하세요. 강의 너무 잘 듣고 있습니다. 다름이 아니라 Authentication authentication = authenticationManager.authenticate(authenticationToken); 를 실행하는 과정에서 WARN 24292 --- [nio-8080-exec-1] o.s.s.c.bcrypt.BCryptPasswordEncoder : Empty encoded password 위와 같은 경고창이 뜨면서 실행되지 않습니다. 강의를 3번 돌려보았고, 소스상에는 문제가 없는데 왜이러는지 모르겠습니다. 참고로 회원가입을할때 Password를 똑같이 "1234"로 입력하여도 DB에 Encoding 된 비밀번호는 동일하지 않습니다.
안녕하세요. 데이터베이스를 이용한 CRUD 구현 > 게시물 생성하기 를 들으면서 service와 controller 코드를 고치고 npm run start:dev 실행을 하니 아래와 같은 오류가 뜹니다. 똑같이 코드를 보며 하고있는데 아래와 같은 오류가 뜨는 이유를 알 수 있을까요?? ERROR [ExceptionHandler] No repository for "BoardRepository" was found. Looks like this entity is not registered in current "default" connection? RepositoryNotFoundError: No repository for "BoardRepository" was found. Looks like this entity is not registered in current "default" connection? at RepositoryNotFoundError.TypeORMError [as constructor] (/Users/Desktop/nestjs_crud/src/error/TypeORMError.ts:7:9) at new RepositoryNotFoundError (/Users/Desktop/nestjs_crud/src/error/RepositoryNotFoundError.ts:10:9) at EntityManager.getRepository (/Users/Desktop/nestjs_crud/src/entity-manager/EntityManager.ts:964:19)
스프링시큐리티 Websecurityconfigureradapter deprecated 문제로 코드 수정해서 새로운 브랜치에 올려두었습니다. https://github.com/codingspecialist/Springboot-Security-JWT-Easy/tree/version2