요청 승인
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
애플리케이션에서 비공개 데이터를 요청할 때 해당 데이터에 액세스할 수 있는 인증된 사용자가 요청을 승인해야 합니다.
애플리케이션에서 공개 데이터를 요청할 때 요청을 승인할 필요는 없지만 API 키와 같은 식별자가 있어야 합니다.
애플리케이션에서 Google Play EMM API로 전송하는 모든 요청에는 승인 토큰이 포함되어야 합니다. Google은 이 토큰을 사용하여 애플리케이션을 식별합니다.
승인 프로토콜 정보
요청을 승인하려면 애플리케이션에서 OAuth 2.0을 사용해야 합니다. 다른 승인 프로토콜은 지원되지 않습니다. 애플리케이션에서 Google 계정으로 로그인을 사용하는 경우, 승인의 일부 절차는 자동으로 처리됩니다.
OAuth 2.0을 사용하여 요청 승인하기
Google Play EMM API에 대한 모든 요청은 인증된 사용자의 승인을 받아야 합니다.
OAuth 2.0의 세부적인 승인 절차('흐름')는 제작 중인 애플리케이션 종류에 따라 약간씩 다릅니다. 다음의 일반적인 과정은 모든 애플리케이션 유형에 적용됩니다.
- 애플리케이션을 만들 때 Google API 콘솔을 사용하여 애플리케이션을 등록합니다. 이렇게 하면 Google에서 클라이언트 ID 및 클라이언트 보안 비밀과 같이 나중에 필요한 정보를 제공합니다.
- Google API 콘솔에서 Google Play EMM API를 활성화합니다. API 콘솔의 목록에 이 API가 없다면 이 단계를 건너뜁니다.
- 애플리케이션에서 사용자 데이터에 액세스해야 하는 경우 Google에 특정 액세스 범위를 요청합니다.
- Google에서 사용자에게 애플리케이션이 일부 데이터를 요청하도록 승인할 것인지 물어보는 동의 화면을 표시합니다.
- 사용자가 승인하면 Google에서 애플리케이션에 제한 시간이 있는 액세스 토큰을 제공합니다.
- 애플리케이션에서 액세스 토큰을 첨부하여 사용자 데이터를 요청합니다.
- Google에서 요청과 토큰이 유효하다고 판단하면 요청된 데이터를 반환합니다.
일부 흐름에는 새로운 액세스 토큰을 얻기 위해 갱신 토큰을 사용하는 등의 추가 단계가 포함됩니다. 다양한 유형의 애플리케이션에 적용되는 흐름을 자세히 알아보려면 Google의 OAuth 2.0 문서를 참조하세요.
다음은 Google Play EMM API의 OAuth 2.0 범위 정보입니다.
https://www.googleapis.com/auth/androidenterprise
OAuth 2.0을 사용하여 액세스를 요청하려면 애플리케이션에 범위 정보와 함께 애플리케이션 등록 시 Google에서 제공하는 정보(예: 클라이언트 ID, 클라이언트 보안 비밀)가 필요합니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-05-08(UTC)
[null,null,["최종 업데이트: 2025-05-08(UTC)"],[[["\u003cp\u003eRequests for private data require authorization from an authenticated user with access, while public data requests need an identifier like an API key but no authorization.\u003c/p\u003e\n"],["\u003cp\u003eAll requests to the Google Play EMM API must include an OAuth 2.0 authorization token for authentication and application identification.\u003c/p\u003e\n"],["\u003cp\u003eApplications must use OAuth 2.0 for authorization, involving registration, API activation, scope definition, user consent, and access token acquisition.\u003c/p\u003e\n"],["\u003cp\u003eThe OAuth 2.0 scope for the Google Play EMM API is \u003ccode\u003ehttps://www.googleapis.com/auth/androidenterprise\u003c/code\u003e, and applications need this scope along with registration information like client ID and secret for access.\u003c/p\u003e\n"]]],[],null,["# Authorize Requests\n\nWhen your application requests private data, the request must be authorized by an authenticated user who has access to that data.\n\nWhen your application requests public data, the request doesn't need to be authorized, but does need to be accompanied by an identifier, such as an API key.\n\nEvery request your application sends to the Google Play EMM API must include an authorization token. The token also identifies your application to Google.\n\nAbout authorization protocols\n-----------------------------\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-----------------------------------\n\nAll requests to the Google Play EMM API 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 Play EMM API 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 Play EMM API: \n\n```\nhttps://www.googleapis.com/auth/androidenterprise\n```\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)."]]