How to fix 'Facebook has detected MyApp isn't using a secure connection to transfer information.' error in Laravel

核能气质少年 提交于 2020-08-24 05:40:30

问题


I am trying to connect my app to facebook login with Laravel and socialite package.But i don't know why facebook show me this error. I searched internet but i couldn't find anything .How can i fix this error ?

I thought that if i make my connection with https it will work but after making https again error appears.

My code in laravel:

web.php

Route::get('login/{provider}', 'SocialController@redirect');
Route::get('login/{provider}/callback','SocialController@Callback');

SocialController.php

    public function redirect($provider)
    {
        return Socialite::driver($provider)->redirect();
    }

    public function Callback($provider){

        $userSocial =   Socialite::driver($provider)->stateless()->user();
        $users       =   User::where(['email' => $userSocial->getEmail()])->first();
        if($users){
            Auth::login($users);
            return redirect('/');
        }else{$user = User::create([
                'username'          => $userSocial->getName(),
                'email'         => $userSocial->getEmail(),
                'provider_id'   => $userSocial->getId(),
                'provider'      => $provider,
            ]);
            return redirect()->route('home');
        }
    }

回答1:


In case of angular : try to serve your app in secured socket layer true mode as Facebook is detecting insecure connection

Use the following command:

ng serve --ssl true


来源:https://stackoverflow.com/questions/57372648/how-to-fix-facebook-has-detected-myapp-isnt-using-a-secure-connection-to-trans

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!