Skip to content

Commit

Permalink
chorm : 어트리뷰트 확인을 위한 로그 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
dltjdgh0428 committed Apr 19, 2024
1 parent 23fbd2a commit e7bd240
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import jakarta.servlet.http.HttpSession;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.oauth2.client.userinfo.DefaultOAuth2UserService;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
Expand All @@ -23,6 +25,7 @@ public class CustomOAuth2UserService extends DefaultOAuth2UserService {

private final UserRepository userRepository;
private final HttpSession httpSession;
private static final Logger logger = LoggerFactory.getLogger(CustomOAuth2UserService.class);


@Override
Expand All @@ -35,6 +38,10 @@ public OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2Authentic

OAuthAttributes attributes = OAuthAttributes.of(registrationId, userNameAttributeName, oAuth2User.getAttributes());

logger.info("registrationId: {}", registrationId);
logger.info("userNameAttributeName: {}", userNameAttributeName);
logger.info("attributes: {}", attributes);

User user = saveOrUpdate(attributes);
httpSession.setAttribute("user", user);
UserDto userDto = new UserDto();
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,5 +116,5 @@ logging:
security: DEBUG
cache: DEBUG
hibernate:
type: trace
type: DEBUG

0 comments on commit e7bd240

Please sign in to comment.