공지사항:
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 Earth Engine 액세스를 유지하기 위해
비상업용 자격 요건을 인증해야 합니다.
ee.data.authenticateViaPrivateKey
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
Google API Node.js 클라이언트를 통해 EE API 호출의 서버 측 인증을 구성합니다. 비공개 키 인증은 서버 측 API 호출 전용입니다. 브라우저 기반 애플리케이션의 경우 ee.data.authenticateViaOauth()를 사용하세요. 서버 측 인증을 사용할 때는 사용자 상호작용 (예: 인증 팝업)이 필요하지 않습니다.
이 인증 방법 또는 다른 인증 방법은 ee.initialize() 전에 호출해야 합니다.
인증 토큰은 가능한 경우 자동으로 새로고침됩니다. 모든 비동기 호출이 적절한 사용자 인증 정보와 함께 전송된다고 가정해도 안전합니다. 하지만 동기 호출의 경우 ee.data.getAuthToken()으로 인증 토큰을 확인하고 없는 경우 ee.data.refreshAuthToken()을 수동으로 호출해야 합니다. 토큰 새로고침 작업은 비동기식이며 동기 호출 전에 주문형으로 백그라운드에서 실행할 수 없습니다.
사용 | 반환 값 |
---|
ee.data.authenticateViaPrivateKey(privateKey, success, error, extraScopes, suppressDefaultScopes) | |
인수 | 유형 | 세부정보 |
---|
privateKey | AuthPrivateKey | 비공개 키의 JSON 콘텐츠입니다. |
success | 함수(선택사항) | 인증이 성공한 경우 호출할 함수입니다. |
error | 함수(선택사항) | 인증이 실패한 경우 호출할 함수입니다. 오류 메시지가 전달됩니다. |
extraScopes | List<String>, 선택사항 | 요청할 추가 OAuth 범위입니다. |
suppressDefaultScopes | 불리언, 선택사항 | true인 경우 opt_extraScopes에 지정된 범위만 요청됩니다. opt_extraScopes에 명시적으로 지정되지 않는 한 기본 범위는 요청되지 않습니다. |
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eEnables server-side authentication for Earth Engine API calls using a private key, suitable for non-browser environments.\u003c/p\u003e\n"],["\u003cp\u003eAuthentication happens automatically for asynchronous calls, but synchronous calls require manual token checks and refresh using \u003ccode\u003eee.data.getAuthToken()\u003c/code\u003e and \u003ccode\u003eee.data.refreshAuthToken()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eee.data.authenticateViaPrivateKey()\u003c/code\u003e function facilitates this authentication process, accepting the private key and optional success/error callbacks, extra scopes, and a flag to suppress default scopes.\u003c/p\u003e\n"]]],[],null,["# ee.data.authenticateViaPrivateKey\n\n\u003cbr /\u003e\n\nConfigures server-side authentication of EE API calls through the Google APIs Node.js Client. Private key authentication is strictly for server-side API calls: for browser-based applications, use ee.data.authenticateViaOauth(). No user interaction (e.g. authentication popup) is necessary when using server-side authentication.\n\n\u003cbr /\u003e\n\nThis or another authentication method should be called before ee.initialize().\n\nThe auth token will be refreshed automatically when possible. You can safely assume that all async calls will be sent with the appropriate credentials. For synchronous calls, however, you should check for an auth token with ee.data.getAuthToken() and call ee.data.refreshAuthToken() manually if there is none. The token refresh operation is asynchronous and cannot be performed behind-the-scenes, on demand, prior to synchronous calls.\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------------------------------------|---------|\n| `ee.data.authenticateViaPrivateKey(privateKey, `*success* `, `*error* `, `*extraScopes* `, `*suppressDefaultScopes*`)` | |\n\n| Argument | Type | Details |\n|-------------------------|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `privateKey` | AuthPrivateKey | JSON content of private key. |\n| `success` | Function, optional | The function to call if authentication succeeded. |\n| `error` | Function, optional | The function to call if authentication failed, passed the error message. |\n| `extraScopes` | List\\\u003cString\\\u003e, optional | Extra OAuth scopes to request. |\n| `suppressDefaultScopes` | Boolean, optional | When true, only scopes specified in opt_extraScopes are requested; the default scopes are not not requested unless explicitly specified in opt_extraScopes. |"]]