[英]laravel socialite showing HTTP Error 403 - Forbidden for google login
Laravel 社交名流顯示 HTTP 錯誤 403 - 禁止在回調中進行谷歌登錄,但對於 facebook 登錄工作正常。 以前它工作正常,但在添加 SSL 后,它顯示錯誤我無法找出問題所在,相同的代碼在另一個子域上運行良好,啟用了 Google plus API。 有人,請幫助我這里是網址 - www.beingreligious.com
當我用谷歌登錄時它返回
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');
}
}
由於在我的域上設置了 Mod-security 規則,我遇到了這個問題。 ModSecurity 是 apache 服務器模塊之一,它通過防御黑客和其他惡意攻擊來提供完整的網站保護。
我要求我的服務器提供商為我的域禁用它,因為我使用的是共享服務器。 之后,我沒有遇到這個問題,谷歌登錄按預期工作。
是的。 實際上它在其他子域上運行良好。 但它顯示 https 錯誤
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.