<small id='uClMC'></small><noframes id='uClMC'>

      <i id='uClMC'><tr id='uClMC'><dt id='uClMC'><q id='uClMC'><span id='uClMC'><b id='uClMC'><form id='uClMC'><ins id='uClMC'></ins><ul id='uClMC'></ul><sub id='uClMC'></sub></form><legend id='uClMC'></legend><bdo id='uClMC'><pre id='uClMC'><center id='uClMC'></center></pre></bdo></b><th id='uClMC'></th></span></q></dt></tr></i><div id='uClMC'><tfoot id='uClMC'></tfoot><dl id='uClMC'><fieldset id='uClMC'></fieldset></dl></div>
      • <bdo id='uClMC'></bdo><ul id='uClMC'></ul>

    1. <legend id='uClMC'><style id='uClMC'><dir id='uClMC'><q id='uClMC'></q></dir></style></legend>

        <tfoot id='uClMC'></tfoot>

        继续获得“超出未经身份验证使用的每日限制".继续使用需要注册"尝试在我的网络应用上使用 google

        时间:2023-07-14
        1. <legend id='2nOQY'><style id='2nOQY'><dir id='2nOQY'><q id='2nOQY'></q></dir></style></legend>

          1. <small id='2nOQY'></small><noframes id='2nOQY'>

            <tfoot id='2nOQY'></tfoot>
            • <i id='2nOQY'><tr id='2nOQY'><dt id='2nOQY'><q id='2nOQY'><span id='2nOQY'><b id='2nOQY'><form id='2nOQY'><ins id='2nOQY'></ins><ul id='2nOQY'></ul><sub id='2nOQY'></sub></form><legend id='2nOQY'></legend><bdo id='2nOQY'><pre id='2nOQY'><center id='2nOQY'></center></pre></bdo></b><th id='2nOQY'></th></span></q></dt></tr></i><div id='2nOQY'><tfoot id='2nOQY'></tfoot><dl id='2nOQY'><fieldset id='2nOQY'></fieldset></dl></div>
                <tbody id='2nOQY'></tbody>

                <bdo id='2nOQY'></bdo><ul id='2nOQY'></ul>

                • 本文介绍了继续获得“超出未经身份验证使用的每日限制".继续使用需要注册"尝试在我的网络应用上使用 google plus 登录时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试在我的网络应用程序上实现 Google plus 注册,并且我按照 google 文档来设置注册,但是当我在接受权限并使用返回给我的访问令牌后尝试注册时,任何 api restcall 我make 返回超出未经身份验证使用的每日限制.继续使用需要注册错误.我已经使用 ouath 2.0 密钥注册了我的应用程序,所以我似乎不明白我做错了什么.这是我的代码.

                  I'm trying to implement Google plus sign up on my web app and I followed the google docs to set up the sign up however when I attempt a signup after accepting permissions and using the access token returned to me any api restcall I make returns the Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup error. I have already signed up my app with a ouath 2.0 key, so I don't seem to get what I'm doing wrong. Here is my code.

                  客户端:

                  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");
                    }
                  };
                  

                  这是我的服务器端代码

                   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);
                  
                              }
                  

                  推荐答案

                  我也遇到了同样的错误 - 超出了未经身份验证的使用的每日限制.继续使用需要注册".

                  I too ran into the same error - "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup".

                  我去检查了我的谷歌开发者控制台 API 下与 API 密钥/身份验证密钥关联的项目,例如,https://console.developers.google.com/project/<your app id>/apiui/api.Google+API 的状态设置为 OFF.我打开了.

                  I went and checked my google developer console under APIs for the project associated with the API key/ auth key, eg, https://console.developers.google.com/project/<your app id>/apiui/api. The status for Google+API was set to OFF. I turned it ON.

                  然后我得到了另一个访问令牌,然后尝试使用新的.它起作用了,即错误消失了,我得到了个人资料的详细信息.为了交叉检查这是否确实是错误的原因,我返回控制台并禁用了 Google+ API.但是现在,我得到了错误:

                  I then got another access token, and then tried with the new one. It worked, ie, the error was gone and I got the profile details. To cross-check if that was indeed the cause of the error, I went back to console and disabled Google+ API. But now, I get the error:

                  未配置访问权限.请使用 Google Developers Console 为您的项目激活 API."

                  "Access Not Configured. Please use Google Developers Console to activate the API for your project."

                  因此,我不能 100% 确定这是在我的开发者控制台中打开/关闭 Google+ API,但请确保它已打开.另外,开机后请等待几分钟,并确保每次尝试之前都获得一个新令牌.

                  So, I am not 100% sure that it was the turning on/off of the Google+ API in my developer console, but do ensure that this is turned on. Also, wait a few minutes after turning on, and ensure that you get a fresh token each time before trying it.

                  这篇关于继续获得“超出未经身份验证使用的每日限制".继续使用需要注册"尝试在我的网络应用上使用 google plus 登录时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 PHP(JWT)验证 Firebase ID 令牌? 下一篇:令牌必须是短期令牌并且在合理的时间范围内

                  相关文章

                    • <bdo id='EcStf'></bdo><ul id='EcStf'></ul>
                    <tfoot id='EcStf'></tfoot>
                    <i id='EcStf'><tr id='EcStf'><dt id='EcStf'><q id='EcStf'><span id='EcStf'><b id='EcStf'><form id='EcStf'><ins id='EcStf'></ins><ul id='EcStf'></ul><sub id='EcStf'></sub></form><legend id='EcStf'></legend><bdo id='EcStf'><pre id='EcStf'><center id='EcStf'></center></pre></bdo></b><th id='EcStf'></th></span></q></dt></tr></i><div id='EcStf'><tfoot id='EcStf'></tfoot><dl id='EcStf'><fieldset id='EcStf'></fieldset></dl></div>
                  1. <small id='EcStf'></small><noframes id='EcStf'>

                  2. <legend id='EcStf'><style id='EcStf'><dir id='EcStf'><q id='EcStf'></q></dir></style></legend>