Skip to content

Commit

Permalink
서버 로그인 에러로그 확인
Browse files Browse the repository at this point in the history
  • Loading branch information
jsangmin99 committed Sep 4, 2024
1 parent 347ce12 commit 9d9554b
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
Expand All @@ -41,6 +42,7 @@

import com.fasterxml.jackson.databind.ObjectMapper; // Jackson 라이브러리 추가

@Slf4j
@Service
@RequiredArgsConstructor
public class AuthService {
Expand Down Expand Up @@ -86,14 +88,17 @@ public TokenResponse googleLogin(GoogleLoginRqDto request) {

private GoogleAccessTokenResponse getAccessTokenFromGoogle(String code) {
String tokenUrl = "https://oauth2.googleapis.com/token";
log.info("getAccessTokenFromGoogle Code: {}", code);

HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);

LinkedMultiValueMap<String, String> params = new LinkedMultiValueMap<>();
params.add("grant_type", "authorization_code");
params.add("code", code);
log.info("code: {}", code);
params.add("redirect_uri", redirectUri); // 프론트엔드에서 설정한 리디렉션 URI
log.info("getAccessTokenFromGoogle redirectUri: {}", redirectUri);
params.add("client_id", googleClientId);
params.add("client_secret", googleClientSecret);

Expand Down

0 comments on commit 9d9554b

Please sign in to comment.