Skip to content

Commit

Permalink
hotfix: oauth member info request http 메서드 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
shinyubin989 committed Jan 26, 2024
1 parent be58a1b commit 7451148
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -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<String, String> 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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@

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 {

@PostExchange(url = "https://kauth.kakao.com/oauth/token", contentType = APPLICATION_FORM_URLENCODED_VALUE)
KakaoTokenResponse requestToken(@RequestParam Map<String, String> 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);
}
Original file line number Diff line number Diff line change
@@ -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<String, String> 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);
}

0 comments on commit 7451148

Please sign in to comment.