使用php登录google时出现问题

使用php登录google时出现问题,php,google-console-developer,Php,Google Console Developer,我正在谷歌登录我的网站。我也在谷歌开发者控制台中设置了谷歌控制台设置。并将此代码用于谷歌登录 但它向我显示了一个错误:400重定向uri不匹配,而我已经设置了重定向url 我的问题不同于,因为我们可以在这个问题中看到,uri没有声明,但我已经声明了 我在下面显示代码 <!DOCTYPE html> <html> <head> <title></title> <script src="https://apis.google.com/

我正在谷歌登录我的网站。我也在谷歌开发者控制台中设置了谷歌控制台设置。并将此代码用于谷歌登录

但它向我显示了一个错误:400重定向uri不匹配,而我已经设置了重定向url

我的问题不同于,因为我们可以在这个问题中看到,uri没有声明,但我已经声明了

我在下面显示代码

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<meta name="google-signin-client_id" content="*********CLIENT-ID********">
<script type="text/javascript">
    function onSignIn(googleUser) {
      var profile = googleUser.getBasicProfile();
      console.log('ID: ' + profile.getId()); // Do not send to your backend! Use an ID token instead.
      console.log('Name: ' + profile.getName());
      console.log('Image URL: ' + profile.getImageUrl());
      console.log('Email: ' + profile.getEmail()); // This is null if the 'email' scope is not present.
    }
</script>
</head>
<body>
<div class="g-signin2" data-onsuccess="onSignIn"></div>
<a href="#" onclick="signOut();" style="display: none;">Sign out</a>
<script>
  function signOut() {
    var auth2 = gapi.auth2.getAuthInstance();
    auth2.signOut().then(function () {
      console.log('User signed out.');
    });
  }
</script>

函数onSignIn(谷歌用户){
var profile=googleUser.getBasicProfile();
console.log('ID:'+profile.getId());//不要发送到后端!改用ID令牌。
log('Name:'+profile.getName());
log('Image URL:'+profile.getImageUrl());
console.log('Email:'+profile.getEmail());//如果“Email”作用域不存在,则此值为null。
}
函数签出(){
var auth2=gapi.auth2.getAuthInstance();
auth2.signOut().then(函数(){
log('User signed out');
});
}

当我点击谷歌注册按钮时,它会在URL上重定向

*******&ss_domain=https%3A%2F%2Fabc.com&fetch_basic_profile=true&gsiwebsdk=2

并向我显示错误:重定向\u uri\u不匹配

我不知道为什么会这样


有人能帮我吗。

重定向\u uri
和谷歌应用程序中定义的一样。甚至
/
都在URL的末尾。检查您的
重定向\u uri
carefully@Gulshan我已经把/放在URL的末尾了。我的重定向uri是正确的,它是我的域名,但仍然不起作用。你在google或google API文档中找到任何解决方案了吗?可能是的,可能是重复的,我试图在google API文档中找到解决方案,但没有找到,这就是为什么我在stackoverflowput
redirect_uri
上提出了一个与google应用程序中定义的相同的问题。甚至
/
都在URL的末尾。检查您的
重定向\u uri
carefully@Gulshan我已经把/放在URL的末尾了。我的重定向uri是正确的,它是我的域名,但仍然不起作用。你在google或google API文档中找到任何解决方案了吗?可能是重复的,我曾尝试在google API文档中找到解决方案,但没有找到,这就是我对stackoverflow提出问题的原因