Continúe obteniendo un "Límite diario de uso no autenticado excedido". El uso continuo requiere registro ”al intentar iniciar sesión con google plus en mi aplicación web

Estoy intentando implementar el registro de Google plus en mi aplicación web y seguí los documentos de Google para configurar el registro. Sin embargo, cuando intento registrarme después de aceptar los permisos y usar el token de acceso que me devolvieron a cualquier API de llamada de retorno, hago Límite diario para uso no autenticado excedido. El uso continuo requiere un error de registro. Ya he registrado mi aplicación con una clave ouath 2.0, por lo que parece que no entiendo lo que estoy haciendo mal. Aquí está mi código.

Lado de Cient:

const clientId = "5XXX000XX.apps.googleusercontent.com";
const apiKey = "AIzaSyCAXE5JSa36jcC*X7HV40SBcIWBiVGUTBE";
const scopes = "https://www.googleapis.com/auth/plus.login";
let accessToken = null;

function initer() {
  gapi.client.setApiKey(apiKey);
  // alert("Hello init");
  if ($("#authorize-button").length > 0) {
    $("#authorize-button").click(onLoginClick);
  }
}

function onLoginClick() {
  // $("#modalLoading").modal();
  // alert("yeah");
  gapi.auth.authorize({ client_id: clientId, scope: scopes, immediate: false }, onConnect);
}

function onConnect(authResult) {
  // alert("On connect");
  if (authResult && !authResult.error) {
    alert("Hey");
    accessToken = authResult.access_token;
    triggerLogin();
  } else {
    alert("Error");
  }
}

triggerLogin = function() {
  alert("Triggering login");
  $("#modalLoading").modal();
  $.ajax({
    url: window.config.site_root + "account/google_login",
    type: "POST",
    data: "access_token=" + accessToken,
    success: onLogin,
    error() {
      onError("Logging In", "starting your session");
    },
  });
};

onLogin = function(login) {
  alert("Login start");
  $("#modalLoading").modal("hide");
  if (login.operation) {
    location.reload();
  } else {
    alert("Register will start");
    triggerRegistration();
  }
};

triggerRegistration = function() {
  $("#modalLoading").modal();
  $.ajax({
    url: window.config.site_root + "account/google_registration",
    type: "POST",
    data: "access_token=" + accessToken,
    success: onRegistration,
    error() {
      alert("An Error");
    },
  });
};

onRegistration = function(data) {
  alert("Handling register");
  $("#modalLoading").modal("hide");
  if (data.account_exists) {
    stage.showErrorModal(
      "Account already registered",
      "There is already an account with that email address, are you sure you created an account using this login method?",
    );
  } else if (data.operation) {
    alert("Login now");
    triggerLogin();
  } else {
    alert("Error");
    onError("Registering", "creating your account");
  }
};

Aquí está mi código del lado del servidor

 public function google_registration()
            {
                $access_token = (isset($_POST["access_token"]) && !empty($_POST["access_token"])) ? $_POST["access_token"] : null;


                $name = null;
                $email = null;
                $account_id = null;
                $picture = null;
                $gender = null;

                try
                {
                    if($access_token)
                    {
                        $me = file_get_contents("https://www.googleapis.com/plus/v1/people/me?access_token=".$access_token);
                        if($me)
                        {
                            $me = json_decode($me);
                            $name = $me->name.formatted;
                            $email = $me->email;
                            $account_id = $me->id;
                            $picture = $me->image;
                            $gender = ($me->gender == "female") ? 1 : 0;
                        }
                    }
                }
                catch(Exception $error)
                {
                    // let the system handle the error quietly.
                }
                return $this->service_registration("google", $name, $email, $account_id, $picture, $gender);

            }

Respuestas a la pregunta(12)

Su respuesta a la pregunta