참고: 이 문서에서는
서드 파티 서비스에 대한 액세스를 요청하는 데 사용되는 3-legged OAuth2 흐름
데이터를 수집하는 데 사용됩니다 자체 인증 서비스를 개발 중인 경우 이 인증 흐름을
서드 파티 애플리케이션에 액세스할 수 있습니다.
판매자 센터 계정 개발 중인 사내 애플리케이션을
판매자 센터 계정에만 액세스할 수 있으므로
서비스
계정 가이드를 참고하세요.
애플리케이션에서 Google Content API for Shopping으로 전송하는 모든 요청에는 승인 토큰이 포함되어야 합니다. Google은 이 토큰을 사용하여 애플리케이션을 식별합니다.
승인 프로토콜 정보
요청을 승인하려면 애플리케이션에서 OAuth 2.0을 사용해야 합니다. 다른 승인 프로토콜은 지원되지 않습니다. 애플리케이션에서 Google 계정으로 로그인을 사용하는 경우, 승인의 일부 절차는 자동으로 처리됩니다.
OAuth 2.0을 사용하여 요청 승인하기
Google Content API for Shopping에 대한 모든 요청은 인증된 사용자의 승인을 받아야 합니다.
OAuth 2.0의 세부적인 승인 절차('흐름')는 제작 중인 애플리케이션 종류에 따라 약간씩 다릅니다. 다음의 일반적인 과정은 모든 애플리케이션 유형에 적용됩니다.
애플리케이션을 만들 때 Google API 콘솔을 사용하여 애플리케이션을 등록합니다. 이렇게 하면 Google에서 클라이언트 ID 및 클라이언트 보안 비밀과 같이 나중에 필요한 정보를 제공합니다.
Google API 콘솔에서 Google Content API for Shopping을 활성화합니다. API 콘솔의 목록에 이 API가 없다면 이 단계를 건너뜁니다.
애플리케이션에서 사용자 데이터에 액세스해야 하는 경우 Google에 특정 액세스 범위를 요청합니다.
Google에서 사용자에게 애플리케이션이 일부 데이터를 요청하도록 승인할 것인지 물어보는 동의 화면을 표시합니다.
사용자가 승인하면 Google에서 애플리케이션에 제한 시간이 있는 액세스 토큰을 제공합니다.
애플리케이션에서 액세스 토큰을 첨부하여 사용자 데이터를 요청합니다.
Google에서 요청과 토큰이 유효하다고 판단하면 요청된 데이터를 반환합니다.
일부 흐름에는 새로운 액세스 토큰을 얻기 위해 갱신 토큰을 사용하는 등의 추가 단계가 포함됩니다. 다양한 유형의 애플리케이션에 적용되는 흐름을 자세히 알아보려면 Google의 OAuth 2.0 문서를 참조하세요.
다음은 Google Content API for Shopping에 대한 OAuth 2.0 범위 정보입니다.
Content API에 액세스하는 모든 앱은 OAuth 인증 검토 절차를 거쳐야 합니다. 사용자
Content API에 액세스하는 미확인 앱은 경고를 받게 되며 앱의 기능이 제한됩니다.
여기서 앱은 Google Cloud에서 고유한 OAuth 2.0 클라이언트 ID로 정의됩니다.
인증 절차는 일반적으로 영업일 기준 3~5일이 소요됩니다. 다음에 대해 자세히 알아보려면
인증 요청을 제출하려면 앱 인증을 참고하세요.
이 정책은 모든 앱에 적용되며 모든 앱은 Google OAuth
최대한 빨리 인증 절차를 진행하여 비즈니스 중단을 방지해야 합니다.
승인 예시
다음 코드는 OAuth 2.0을 사용하여 클라이언트를 구성하고 요청을 승인하는 방법을 보여줍니다.
웹 애플리케이션을 위한 것입니다 다른 언어는 샘플 및 라이브러리 페이지에서 제공됩니다.
PHP
이 예에서는 웹 애플리케이션 흐름을 사용합니다. 리디렉션 URI는 이 PHP 페이지의 URI여야 합니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-25(UTC)"],[[["\u003cp\u003eThis guide explains how third-party applications can use OAuth 2.0 to access Google Merchant Center account data.\u003c/p\u003e\n"],["\u003cp\u003eApplications must be registered in the Google API Console and authorized by the user to access specific data scopes.\u003c/p\u003e\n"],["\u003cp\u003eThe authorization process involves obtaining an access token, which is then included in API requests to the Google Content API for Shopping.\u003c/p\u003e\n"],["\u003cp\u003eAll apps accessing the Content API need to be verified through a process that usually takes 3-5 business days for uninterrupted service.\u003c/p\u003e\n"],["\u003cp\u003eIncremental authorization is recommended to avoid user issues with selecting multiple data access scopes during authorization.\u003c/p\u003e\n"]]],["Applications seeking access to Google Content API for Shopping must use OAuth 2.0. The process involves registering the application with Google to obtain a client ID and secret. Applications then request specific access scopes. Users are prompted via a consent screen to authorize the requested access. Upon approval, the application receives a short-lived access token to attach to its requests. It is important to request app verification, since unverified app users will get warnings. The given PHP code demonstrates this OAuth 2.0 process.\n"],null,["**Note:** This document describes the\nthree-legged OAuth2 flow used to request access to other parties'\ndata. Use this authentication flow if you're developing a\nthird-party application that needs access to your clients'\nMerchant Center accounts. If you are developing an in-house application that\nwill only access your own Merchant Center account, please look at\nthe [Service\nAccounts](/shopping-content/guides/how-tos/service-accounts) guide instead.\n\nEvery request your application sends to the Google Content API for Shopping must include an authorization token. The token also identifies your application to Google.\n\nAbout authorization protocols\n\nYour application must use [OAuth 2.0](https://developers.google.com/identity/protocols/OAuth2) to authorize requests. No other authorization protocols are supported. If your application uses [Sign In With Google](https://developers.google.com/identity/gsi/web), some aspects of authorization are handled for you.\n\nAuthorizing requests with OAuth 2.0\n\nAll requests to the Google Content API for Shopping must be authorized by an authenticated user.\n\nThe details of the authorization process, or \"flow,\" for OAuth 2.0 vary somewhat depending on what kind of application you're writing. The following general process applies to all application types:\n\n1. When you create your application, you register it using the [Google API Console](https://console.cloud.google.com/). Google then provides information you'll need later, such as a client ID and a client secret.\n2. Activate the Google Content API for Shopping in the Google API Console. (If the API isn't listed in the API Console, then skip this step.)\n3. When your application needs access to user data, it asks Google for a particular **scope** of access.\n4. Google displays a **consent screen** to the user, asking them to authorize your application to request some of their data.\n5. If the user approves, then Google gives your application a short-lived **access token**.\n6. Your application requests user data, attaching the access token to the request.\n7. If Google determines that your request and the token are valid, it returns the requested data.\n\nSome flows include additional steps, such as using **refresh tokens** to acquire new access tokens. For detailed information about flows for various types of applications, see Google's [OAuth 2.0 documentation](https://developers.google.com/identity/protocols/OAuth2).\n\nHere's the OAuth 2.0 scope information for the Google Content API for Shopping:\n\n| Scope | Meaning |\n|-------------------------------------------|--------------------|\n| `https://www.googleapis.com/auth/content` | Read/write access. |\n\nTo request access using OAuth 2.0, your application needs the scope information, as well as\ninformation that Google supplies when you register your application (such as the client ID and the\nclient secret).\n\n**Tip:** The Google APIs client libraries can handle some of the authorization process for you. They are available for a variety of programming languages; check the [page with libraries and samples](/shopping-content/v2/libraries) for more details.\n\nGet OAuth scopes\n\n\nWe recommend using [incremental\nauthorization](/identity/protocols/oauth2/web-server#incrementalAuth) to avoid problems with scope selection.\n\n\n[OAuth scopes](/identity/protocols/oauth2/scopes) are\nunselected by default in the consent screen for your app if you request more than one. When your app\npresents the consent screen to a user, they have to manually select each scope to authorize access.\n\n\nCheck the response from an OAuth request to verify that you received the appropriate scopes.\n\n\nSee the [OAuth 2.0 Policies](/identity/protocols/oauth2/policies#unbundled-consent) page\nfor more details.\n\nRequest app verification\n\n\nAny apps that access the Content API must go through the OAuth verification review process. Users of\nunverified apps that access the Content API will receive [warnings](//support.google.com/cloud/answer/7454865) and the apps will have [limited functionality](//support.google.com/cloud/answer/7454865#unverified-app-user-cap).\nAn app, in this context, is defined as a unique OAuth 2.0 Client ID in Google Cloud.\n\n\nThe verification process typically takes 3-5 business days to complete. To learn more about about\nthe process and to submit a request for verification, refer to [Verification for apps.](//support.google.com/cloud/answer/7454865#verification)\n\n\nThis policy applies to all apps, and we recommend that all apps undergo the Google OAuth\nverification process at their earliest convenience to avoid any business interruptions.\n\nAuthorization Example\n\n\nThe following code demonstrates how to configure your client and authorize requests using OAuth 2.0\nfor web applications. Other languages are available at our [Samples and Libraries](/shopping-content/guides/libraries) page. \n\nPHP\n\nThis example uses the [Web Application flow](/accounts/docs/OAuth2WebServer). The redirect URI should be the URI of this PHP page. \n\n```php\n\u003c?php\nrequire_once 'Google/Client.php';\n\nsession_start();\n\n$client = new Google_Client();\n$client-\u003esetApplicationName('Sample Content API application');\n$client-\u003esetClientId('\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_CLIENT_ID\u003c/var\u003e');\n$client-\u003esetClientSecret('\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_CLIENT_SECRET\u003c/var\u003e');\n$client-\u003esetRedirectUri('\u003cvar class=\"apiparam\" translate=\"no\"\u003eYOUR_REDIRECT_URI\u003c/var\u003e');\n$client-\u003esetScopes('https://www.googleapis.com/auth/content');\n\nif (isset($_SESSION['oauth_access_token'])) {\n $client-\u003esetAccessToken($_SESSION['oauth_access_token']);\n} elseif (isset($_GET['code'])) {\n $token = $client-\u003eauthenticate($_GET['code']);\n $_SESSION['oauth_access_token'] = $token;\n} else {\n header('Location: ' . $client-\u003ecreateAuthUrl());\n exit;\n}\n```\n\nNow that you have authenticated, you can create a Service object to make API requests with. \n\n```php\nrequire_once 'Google/Service/ShoppingContent.php';\n\n$service = new Google_Service_ShoppingContent($client);\n```"]]