Laravel社交名流显示HTTP错误403-禁止回调中的Google登录,但可以正常使用Facebook登录。以前它工作正常,但是添加SSL后却显示错误,我无法找出问题所在,相同的代码在另一个子域上运行良好,启用了Google plus API。有人请帮帮我 这是网址-www.beingreligious.com
当我用google登录时返回
https://www.beingreligious.com/auth/google/callback?state=JSqZHyIkS6bLMTMHZ4dMmbgXJwbXuDiwOqVBSp7I&code=4/WgDWcviWNpyVBB4ScPG7mNzQAveXOAlc9dQ5bvwn7BVhfUyCBegloMU7lK3O7hGxSphyHp86Nm36Vl40eE3LsNc&scope=https://www.googleapis.com/auth/plus.me+https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/userinfo.email&authuser=1&session_state=db2d5443920526f58d68ac724e14f4e5af70497f..2a92&prompt=consent#
这是回调函数
public function handleProviderCallback(Request $request,$provider)
{
//echo "here"; die;
$user = Socialite::driver($provider)->user();
$authUser = $this->findOrCreateUser($user, $provider,$request);
Auth::login($authUser, true);
$next=session()->get('nextbtn');
if($next!='')
{
return redirect('/check_sign_up?next='.$next);
}else{
return redirect('/check_sign_up');
}
}
答案 0 :(得分:2)
由于我的域中设置了Mod安全规则,因此我遇到了此问题。 ModSecurity是apache服务器模块之一,可通过防御黑客和其他恶意攻击来提供完整的网站保护。
我请求服务器提供商针对我的域禁用它,因为我正在使用共享服务器。之后,我没有遇到这个问题,并且google登录正常。
答案 1 :(得分:0)
答案 2 :(得分:0)