Skip to content

Commit

Permalink
Merge pull request #183 from 1223v/login
Browse files Browse the repository at this point in the history
Fix: 애플 oauth json 파싱 invalid_user_info_response 에러 수정
  • Loading branch information
1223v authored Feb 28, 2024
2 parents 5783e42 + 3878f69 commit 5c455de
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic
String idToken = userRequest.getAdditionalParameters().get("id_token").toString();
attributes = decodeJwtTokenPayload(idToken);
attributes.put("id_token", idToken);

System.out.println("attributes = " + attributes);
System.out.println("userNameAttributeName = " + userNameAttributeName);

// socialType에 따라 유저 정보를 통해 OAuthAttributes 객체 생성
OAuthAttributes extractAttributes = OAuthAttributes.of(socialType, userNameAttributeName, attributes);

System.out.println("extractAttributes = " + extractAttributes);
UserInfo createdUser = getUser(extractAttributes, socialType); // getUser() 메소드로 User 객체 생성 후 반환
System.out.println("createdUser = " + createdUser);
// CustomOAuth2User 객체 생성
return new CustomOAuth2User(
Collections.singleton(new SimpleGrantedAuthority(createdUser.getRole().getKey())),
Expand Down

0 comments on commit 5c455de

Please sign in to comment.