강의

멘토링

커뮤니티

Inflearn Community Q&A

hangs09086999's profile image
hangs09086999

asked

Spring Security OAuth2

Understanding and Using OAuth2AuthorizedClient

AuthorizedClient를 Service를 통해서 가져올시

Written on

·

289

·

Edited

0

위에 사진으로 authorizedClient가 nullpoint 에러가 발생합니다.

 

repository시에는 authorizedClient는 잘 가져오는데 service로 load시에 못 가져오는거 같습니다. 왜 그런건지 궁금합니다

javaspringspring-bootoauth

Answer 1

0

hangs0908님의 프로필 이미지
hangs0908
Questioner

다음 강의를 보고 나름 해결했는데
Service 같은 경우 구현체가 InMemory와 Jdbc가 있는데 이 두 클래스는 인증된 사용자일 경우만 사용되어서 위와 같이 Service를 통해 AuthorizedClient를 조회할 경우 Null Point 에러가 발생한거 같네요.

 

Repository는 익명 사용자일 경우에도 조회할 수 있어서 nullpoint 에러가 발생하지 않았구요.

 

감사합니다

leaven님의 프로필 이미지
leaven
Instructor

아 네 맞습니다.

두 클래스의 차이점을 잘 파악하신 것 같습니다.

hangs09086999's profile image
hangs09086999

asked

Ask a question