使用laravel 5.1社交名流的Facebook身份验证 [英] facebook authentication using laravel 5.1 socialite

查看:47
本文介绍了使用laravel 5.1社交名流的Facebook身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我使用本地主机,所以我最近切换到了laravel 5.1,我尝试使用它提供的"socialite",所以我更新了我的configservices.env文件,因此在我的路线中也添加了这些代码

Route::get('/', function () {
return view('welcome');
 });
 Route::get('auth/facebook', 'Auth\AuthController@redirectToProvider');
 Route::get('auth/facebook/callback','Auth\AuthController@handleProviderCallback');
Route::get('home', array('as' => 'home', 'uses' => function(){
return view('home');
}));

然后在我的AuthController中,我有以下代码

在我看来,使用Facebook登录"按钮的hrefauth/facebook,但是发生的事情是facebook给我一个错误提示

注意:我也将我的Facebook应用程序发布到了Facebook开发人员中 我也将此添加到了我的域中但也有警告

我仍然对我的错误所在感到困惑.知道我在做什么错吗?感谢您的建议.

解决方案

您是否已将站点url值检查到站点URL 字段中.更新并检查.

这应该对您有用.

hello im using localhost so i have recently switched to laravel 5.1 and im trying to use 'socialite' it provides so i have updated my config , services and the .env files so in my routes i also added these codes

Route::get('/', function () {
return view('welcome');
 });
 Route::get('auth/facebook', 'Auth\AuthController@redirectToProvider');
 Route::get('auth/facebook/callback','Auth\AuthController@handleProviderCallback');
Route::get('home', array('as' => 'home', 'uses' => function(){
return view('home');
}));

then in my AuthController i have these codes

in my view the button 'login with facebook' has the href of auth/facebook but what happens is facebook is giving me an error saying

note: i also made my facebook app live in the facebook developers i also added this on my domain but also have a warning

im still confused on where my error is. any idea what im doing wrong? thanks for advices.

解决方案

Have you checked your site url value into Site URL field. Update it and check.

This should be work for you.

这篇关于使用laravel 5.1社交名流的Facebook身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆