package com.takensoft.common.oauth.service;

import org.springframework.security.oauth2.client.userinfo.OAuth2UserRequest;
import org.springframework.security.oauth2.client.userinfo.OAuth2UserService;
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
import org.springframework.security.oauth2.core.user.OAuth2User;

/**
 * @author takensoft
 * @since 2025.05.22
 * @modification
 *     since    |    author    | description
 *  2025.05.22  |  takensoft   | 최초 등록
 *
 * OAuth2 사용자 정보 서비스 인터페이스
 */
public interface CustomOAuth2UserService extends OAuth2UserService<OAuth2UserRequest, OAuth2User> {

    /**
     * @param userRequest - OAuth2 사용자 요청
     * @return OAuth2User - OAuth2 사용자 정보
     * @throws OAuth2AuthenticationException - OAuth2 인증 예외
     *
     * OAuth2 사용자 정보 로드
     */
    OAuth2User loadUser(OAuth2UserRequest userRequest) throws OAuth2AuthenticationException;
}