Facebook Configuration
Hi,
I am new to Anvard and Laravel and am probably doing something wrong when following the readme so excuse me in advance.
When I test the Facebook login I get the following page: "HybridAuth Open Source Social Sign On PHP Library. hybridauth.sourceforge.net/"
I also see the following in the logs: "log.DEBUG: Anvard: attempting login [] []"
Could you help me debug this issue?
Comments (5)
-
-
Create a file in app/storage/logs/ and name it hauth_debug_file.txt then Add the following to your
/config/packages/anvard/hybridauth.php
"debug_mode" => true, "debug_file" =>"D:\www\Dev\bp4\app\storage\logs\hauth_debug_file.txt", //change this path with yours
this will dump a lot of good info for debugging in the file, then you can share the file to help solve the problem. So your file would look something like this:
<?php return array( // 'base_url' => URL::route(Config::get('anvard::routes.login')), 'providers' => array ( 'Facebook' => array ( 'enabled' => true, 'keys' => array ( 'id' => 'yourr-key', 'secret' => 'your-secret' ), //'scope' => Input::get('permission_scope','email, user_about_me, user_birthday, user_hometown, user_likes, user_interests, user_location'), ), 'Twitter' => array ( 'enabled' => false, 'keys' => array ( 'key' => '', 'secret' => '' ) ), 'LinkedIn' => array ( 'enabled' => false, 'keys' => array ( 'key' => '', 'secret' => '' ) ), ), "debug_mode" => true, "debug_file" =>"D:\www\Dev\bp4\hauth_debug_file.txt", );
-
I also had to edit Atticmedia/Anvard/Anvard.php around line 230 to
$attributes['user_id'] = $user->id; $profile = new $ProfileModel(); foreach ($attributes as $key => $v) { $profile->$key = $v; } $profile = $this->applyAdapterProfileToExistingProfile($adapter_profile, $profile); return $profile;
-
<?php class Profile extends Eloquent { // fix provider error. protected $fillable = array('user_id', 'provider'); public function user() { return $this->belongsTo('User'); } }
This fixed a "provider" exception when filling the profile.
-
- changed status to closed
Please reopen if needed.
- Log in to comment
If you follow the readme and make sure your database connection is made, the first indication that it's working is if you go to:
{your-host}/anvard/
If you have set up your social networks, enabled them with the relevant API keys, you should see a link to the social network. Clicking it, should bring up the auth page.