cornernote/yii-account-module

HybridAuth integration (how to?)

Opened this issue · 11 comments

@cornernote

This is the HybridAuth section in the account module of the app configuration file (main.php):

'hybridAuthConfig' => array(
    // url to the hybridAuth action
    'base_url' => realpath(__DIR__ . '/../../account/hybridAuth'),
    'providers' => array(
        'google' => array(
            'enabled' => true,
            'name' => 'Google+',
            'keys' => array(
                'id' => '',
                'secret' => '',
            ),
            'scope' => '',
        ),
        'facebook' => array(
            'enabled' => true,
            'name' => 'Facebook',
            'keys' => array(
                'id' => '',
                'secret' => '',
            ),
            'scope' => 'email,publish_stream',
            'display' => '',
        ),
        'twitter' => array(
            'enabled' => true,
            'name' => 'Twitter',
            'keys' => array(
                'key' => '',
                'secret' => '',
            ),
        ),
        'linkedin' => array(
            'enabled' => true,
            'name' => 'LinkedIn',
            'keys' => array(
                'key' => '',
                'secret' => '',
            ),
        ),
        'yahoo' => array(
            'enabled' => true,
            'name' => 'Yahoo!',
        ),
        'openid' => array(
            'enabled' => true,
            'name' => 'OpenID',
        ),
    ),
),

This is the AccountController

class AccountController extends CController
{

    public function filters()
    {
        return array(
            'accessControl',
        );
    }

    public function actions()
    {
        return array(
            'signUp' => array(
                'class' => 'account.actions.AccountSignUpAction',
                'view' => 'account.views.account.sign_up',
                'formClass' => 'AccountSignUp',
                'returnUrl' => null, // defaults to returnUrl or homeUrl depending on activatedAfterSignUp setting
            ),
            'activate' => array(
                'class' => 'account.actions.AccountActivateAction',
                'formClass' => 'AccountActivate',
                'returnUrl' => null, // defaults to homeUrl
            ),
            'resendActivation' => array(
                'class' => 'account.actions.AccountResendActivationAction',
                'view' => 'account.views.account.resend_activation',
                'formClass' => 'AccountResendActivation',
            ),
            'lostPassword' => array(
                'class' => 'account.actions.AccountLostPasswordAction',
                'view' => 'account.views.account.lost_password',
                'formClass' => 'AccountLostPassword',
            ),
            'resetPassword' => array(
                'class' => 'account.actions.AccountResetPasswordAction',
                'view' => 'account.views.account.reset_password',
                'formClass' => 'AccountResetPassword',
            ),
            'login' => array(
                'class' => 'account.actions.AccountLoginAction',
                'view' => 'account.views.account.login',
                'formClass' => 'AccountLogin',
            ),
            'logout' => array(
                'class' => 'account.actions.AccountLogoutAction',
            ),
            'index' => array(
                'class' => 'account.actions.AccountViewAction',
                'view' => 'account.views.account.view',
            ),
            'update' => array(
                'class' => 'account.actions.AccountUpdateAction',
                'view' => 'account.views.account.update',
                'formClass' => 'AccountUpdate',
                'returnUrl' => array('/account/index'),
            ),
            'password' => array(
                'class' => 'account.actions.AccountChangePasswordAction',
                'view' => 'account.views.account.change_password',
                'formClass' => 'AccountChangePassword',
                'returnUrl' => array('/account/index'),
            ),
            'hybridAuth' => array(
                'class' => 'account.actions.AccountHybridAuthAction',
//                'view' => 'account.views.account.change_password',
//                'formClass' => 'AccountChangePassword',
//                'returnUrl' => array('/account/index'),
            ),
        );
    }

}

This is the link where you can see what happens:
http://testing.com.ar/yii-1.1.17/account/login
where you can see what kind of error I am getting.

Not that I can be aware of...
include(Hybrid_Auth.php): failed to open stream: No such file or directory
is the error that comes out anyway

These are the extensions/modules installed in this template that I am building
yii-framework 1.1.17
facebook/graph-sdk 5.4.4
hybridauth/hybridauth 2.8.2
twbs/bootstrap 3.3.7
crisu83/yiistrap 2.0.3
cornernote/yii-return-url 1.0.2
cornernote/yii-token-manager 1.0.2
mustache/mustache 2.11.1
swiftmailer/swiftmailer 5.4.5
cornernote/yii-email-module 1.3.1
cornernote/yii-account-module 1.3.0
crisu83/yii-auth 1.7.0
yiiwheels 2.0.3

and the hybridAuth module has been loaded into the correct vendor/hybridauth/hybridauth folder

NO and dont understand why I should have it....

I changed my index.php this way:

<?php

// change the following paths if necessary
$yii=dirname(__FILE__).'/../../f/yii-1.1.17/framework/yii.php';
$config=dirname(__FILE__).'/protected/config/main.php';

// remove the following lines when in production mode
defined('YII_DEBUG') or define('YII_DEBUG',true);
// specify how many levels of call stack should be shown in each log message
defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);

require(dirname(__FILE__).'/protected/vendor/autoload.php');
require_once($yii);
Yii::createWebApplication($config)->run();

and now i get this error
require_once(/var/www/html/yii-1.1.17/protected/vendor/hybridauth/hybridauth/hybridauth/Hybrid/Providers/facebook.php): failed to open stream: No such file or directory

I did it but now the image below is not that good
Take a look at it please
http://testing.com.ar/yii-1.1.17/account/login