首页 文章

使用我网页上的google登录按钮登录时收到错误400

提问于
浏览
0

我试图在我的网站上放置一个谷歌登录按钮,但是当我尝试使用它登录时出现400错误 . 这就是我得到的 .

400. That’s an error.

The requested URL was not found on this server. That’s all we know.the

我在 <head> 中包含以下内容:

<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="620096179377-ula3qjt2s01qqhberlqq470n16kccnh5.apps.googleusercontent.com">

以及我想要的按钮:

<div class="g-signin2" data-onsuccess="onSignIn"></div>

1 回答

  • 0

    此代码应该适合您:

    <html>
    <head>
      <title>Test Google Login</title>
      <script src="https://apis.google.com/js/platform.js" async defer></script>
      <meta name="google-signin-client_id" content="620096179377-ula3qjt2s01qqhberlqq470n16kccnh5.apps.googleusercontent.com">
      <script>
      function onSignIn(googleUser) {
        console.log(googleUser);
      }
      </script>
    </head>
    <body>
      <div class="g-signin2" 
       data-onsuccess="onSignIn"></div>
    </body>
    </html>
    

    如果问题仍然存在,您是否可以附上导致400的请求的详细信息? (网址应该足够了)

相关问题