0

I am new to Google earth engine. I am using earth engine javascript api (ee_api_js.js).

var onImmediateFailed = function() {
    ee.data.authenticateViaPopup(function() {
      runAnalysis();
    });
};
ee.data.authenticateViaOauth(CLIENT_ID, runAnalysis, null, null, onImmediateFailed);

When I run it the first time on any browser it always goes to "onImmediateFailed". I am not sure what settings needs to be done in order to always succeed while executing this.

I am creating a web app where users will navigate to earth engine functions and I don't want user to have to login to their Google account.

  • As shown in the comment here this will always fail unless the user is already authenticated. Either your app has to authenticate (via service account) or your user does. If it's the former, then use ee.ServiceAccountCredentials(). If it's the latter, then you have no choice but to let the user login. – Nicholas Clinton Jul 24 '18 at 23:09
  • Is there any reference how to use ee.ServiceAccountCredentials() ? that would be great help. Thanks – Nitin Muchhadiya Jul 29 '18 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.