diff --git a/src/main/java/com/baro/auth/infra/oauth/google/GoogleRequestApi.java b/src/main/java/com/baro/auth/infra/oauth/google/GoogleRequestApi.java index b576e80..071406f 100644 --- a/src/main/java/com/baro/auth/infra/oauth/google/GoogleRequestApi.java +++ b/src/main/java/com/baro/auth/infra/oauth/google/GoogleRequestApi.java @@ -1,21 +1,21 @@ package com.baro.auth.infra.oauth.google; +import static org.springframework.http.HttpHeaders.AUTHORIZATION; +import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; + import com.baro.auth.infra.oauth.google.dto.GoogleMemberResponse; import com.baro.auth.infra.oauth.google.dto.GoogleTokenResponse; +import java.util.Map; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.service.annotation.GetExchange; import org.springframework.web.service.annotation.PostExchange; -import java.util.Map; - -import static org.springframework.http.HttpHeaders.AUTHORIZATION; -import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; - public interface GoogleRequestApi { @PostExchange(url = "https://oauth2.googleapis.com/token", contentType = APPLICATION_FORM_URLENCODED_VALUE) GoogleTokenResponse requestToken(@RequestParam Map params); - @PostExchange(url = "https://www.googleapis.com/oauth2/v2/userinfo", contentType = APPLICATION_FORM_URLENCODED_VALUE) + @GetExchange(url = "https://www.googleapis.com/oauth2/v2/userinfo") GoogleMemberResponse requestMemberInfo(@RequestHeader(name = AUTHORIZATION) String accessToken); } diff --git a/src/main/java/com/baro/auth/infra/oauth/kakao/KakaoRequestApi.java b/src/main/java/com/baro/auth/infra/oauth/kakao/KakaoRequestApi.java index 442da70..fe2d1b5 100644 --- a/src/main/java/com/baro/auth/infra/oauth/kakao/KakaoRequestApi.java +++ b/src/main/java/com/baro/auth/infra/oauth/kakao/KakaoRequestApi.java @@ -6,11 +6,10 @@ import com.baro.auth.infra.oauth.kakao.dto.KakaoMemberResponse; import com.baro.auth.infra.oauth.kakao.dto.KakaoTokenResponse; - import java.util.Map; - import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.service.annotation.GetExchange; import org.springframework.web.service.annotation.PostExchange; public interface KakaoRequestApi { @@ -18,6 +17,6 @@ public interface KakaoRequestApi { @PostExchange(url = "https://kauth.kakao.com/oauth/token", contentType = APPLICATION_FORM_URLENCODED_VALUE) KakaoTokenResponse requestToken(@RequestParam Map params); - @PostExchange(url = "https://kapi.kakao.com/v2/user/me", contentType = APPLICATION_FORM_URLENCODED_VALUE) + @GetExchange(url = "https://kapi.kakao.com/v2/user/me") KakaoMemberResponse requestMemberInfo(@RequestHeader(name = AUTHORIZATION) String accessToken); } diff --git a/src/main/java/com/baro/auth/infra/oauth/naver/NaverRequestApi.java b/src/main/java/com/baro/auth/infra/oauth/naver/NaverRequestApi.java index 7ecb95c..ffad4dd 100644 --- a/src/main/java/com/baro/auth/infra/oauth/naver/NaverRequestApi.java +++ b/src/main/java/com/baro/auth/infra/oauth/naver/NaverRequestApi.java @@ -1,21 +1,21 @@ package com.baro.auth.infra.oauth.naver; +import static org.springframework.http.HttpHeaders.AUTHORIZATION; +import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; + import com.baro.auth.infra.oauth.naver.dto.NaverMemberResponse; import com.baro.auth.infra.oauth.naver.dto.NaverTokenResponse; +import java.util.Map; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.service.annotation.GetExchange; import org.springframework.web.service.annotation.PostExchange; -import java.util.Map; - -import static org.springframework.http.HttpHeaders.AUTHORIZATION; -import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED_VALUE; - public interface NaverRequestApi { @PostExchange(url = "https://nid.naver.com/oauth2.0/token", contentType = APPLICATION_FORM_URLENCODED_VALUE) NaverTokenResponse requestToken(@RequestParam Map params); - @PostExchange(url = "https://openapi.naver.com/v1/nid/me", contentType = APPLICATION_FORM_URLENCODED_VALUE) + @GetExchange(url = "https://openapi.naver.com/v1/nid/me") NaverMemberResponse requestMemberInfo(@RequestHeader(name = AUTHORIZATION) String accessToken); }