communityii / yii2-user

Configurable Yii 2 user management module with social authentication and various controls
https://groups.google.com/d/forum/communityii
Other
50 stars 9 forks source link

Errors in social auth #27

Closed it3rmit closed 9 years ago

it3rmit commented 9 years ago

After updates (e45eadc) in social authentication I have faced some issues. 1) When the authClientCollection isn't specified in components section I get an exception:

Unknown Property – yii\base\UnknownPropertyException
Getting unknown property: yii\web\Application::authClientCollection

1. in /var/www/user/vendor/yiisoft/yii2/base/Component.php at line 143
2. in /var/www/user/vendor/yiisoft/yii2/di/ServiceLocator.php at line 73 – yii\base\Component::__get('authClientCollection')
3. in /var/www/user/vendor/communityii/yii2-user/Module.php at line 974 – yii\di\ServiceLocator::__get('authClientCollection')

And it doesn't matter what value the property socialSettings['enabled'] has true or false

'socialSettings' => [
      'enabled' => true
],

2) If I set up the authClientCollection in components

'authClientCollection' => [
            'class' => 'yii\authclient\Collection',
            'clients' => [

                'google' => [
                    'class' => 'yii\authclient\clients\GoogleOpenId'
                ],

            ],
        ],

everything works fine. But when I click on Google icon the new popup appears with url /user/auth/google and I am getting an error:

Exception – yii\base\Exception
No servers found!

    1. in /var/www/user/vendor/yiisoft/yii2-authclient/OpenId.php at line 497

Do I need to specify something else in configuration? I took an a snippet from the markdown documentation.

kartik-v commented 9 years ago

This is been fixed via 6536f70.

it3rmit commented 9 years ago

I have just updated the packages via composer and cleared cache in browser after your response. And both problems still exist.

kartik-v commented 9 years ago

Ok will check...

kartik-v commented 9 years ago

You can check now.

it3rmit commented 9 years ago

This is strange. After updates I updated packages and cleared cache again to be sure and I still get errors. When 'authClientCollection' isn't specified in components section I get

Invalid Configuration – yii\base\InvalidConfigException

You must setup the `authClientCollection` component and its `clients` in your app configuration file.

The 2-nd issue with Google authorization isn't solved either. I also see blank image placeholder near Avatar in /user/profile/1 when I use chrome (nothing in ff).

kartik-v commented 9 years ago

If socialSettings['enabled'] is true you must set authClientCollection component and if not done ... you will get the above exception.