3

I'm using Yii framework and HybridAuth for social login action,i have google and yahoo works fine, but i can't make facebook and twitter to work.

Do i need an Https:// domain for that ? or is just some configuration to add ?

When i try to login using facebook or twitter i get this PHP Warning :

include(DefaultController.php) [function.include]: failed to open stream: No such file or directory

The error show up at vendors\yii_1.1.10\YiiBase.php(418):

{
407                     foreach(self::$_includePaths as $path)
408                     {
409                         $classFile=$path.DIRECTORY_SEPARATOR.$className.'.php';
410                         if(is_file($classFile))
411                         {
412                             include($classFile);
413                             break;
414                         }
415                     }
416                 }
417                 else
418                     include($className.'.php');
419             }
420             else  // class name with namespace in PHP 5.3
421             {
422                 $namespace=str_replace('\\','.',ltrim($className,'\\'));
423                 if(($path=self::getPathOfAlias($namespace))!==false)
424                     include($path.'.php');
425                 else
426                     return false;
427             }
428             return class_exists($className,false) || interface_exists($className,false);
429         }
430         return true;

Here is my main config file

'modules'=>array('admin',
        'hybridauth' => array(
            'baseUrl' => 'http://'. $_SERVER['SERVER_NAME'] . '/hybridauth', 
            'withYiiUser' => false, // Set to true if using yii-user
            "providers" => array ( 

                "yahoo" => array ( 
                    "enabled" => true 
                ),

                "google" => array ( 
                    "enabled" => true,
                    "keys"    => array ( "id" => "[private]", "secret" => "[private]" ),
                    "scope"   => ""
                ),

                "facebook" => array ( 
                    "enabled" => true,
                    "keys"    => array ( "id" => "[private]", "secret" => "[private]" ),
                    "scope"   => "email,publish_stream", 
                    "display" => "" 
                ),

                "twitter" => array ( 
                    "enabled" => true,
                    "keys"    => array ( "key" => "[private]", "secret" => "[private]" ) 
                )
            )
        )
    ),
ImadT
  • 491
  • 1
  • 5
  • 21
  • 1
    i will try this out tonight and let you know if it works for my app, my app work with oAuth for all 4, so i can let you know if it is the plugin or just you. – DarkMukke Jan 18 '13 at 07:24
  • it worked just fine for me, are you sure your keys are correct ? – DarkMukke Jan 22 '13 at 07:16
  • Probably, if I can remember correctly, this was due to a strange string returned by Facebook. Do you get something like http://example.com/index.php#_#? If so then the #_# is the reason. – Mina Abadir Jan 26 '13 at 17:35

2 Answers2

1

I had the same error while installing HybridAuth. Solved it by changing the case of some files.

My Linux server is case sensitive, so the file 'facebook.php' could not be found, while 'Facebook.php' worked

Mtvw
  • 336
  • 1
  • 7
1

Try importing the hybridauth files:

config/main.php

'import'=>array(
    ...
    // for hybridauth
    'application.modules.hybridauth.controllers.*',
    ...
),
Afif Sohaili
  • 246
  • 3
  • 11