Mr Rost Mr Rost - 1 year ago 301
PHP Question

Unknown component ID: authClientCollection

Im doing my site like this tutorial,
but when I'm trying to going to my localhost/basic/web/index.php I have that error:

Invalid Configuration – yii\base\InvalidConfigException

Unknown component ID: authClientCollection

in basic\vendor\yiisoft\yii2\di\ServiceLocator.php

maybe its problem in my config. I haven't in my config folder main.php file and I creating it and add data like in tutorial.

Answer Source

Check in you basic/config/web.php and add in component section the requiredc params

'components' => [
    'authClientCollection' => [
      'class' => 'yii\authclient\Collection',
      'clients' => [
        'facebook' => [
          'class' => 'yii\authclient\clients\Facebook',
          'authUrl' => '',
          'clientId' => 'YOUR APP CLIENT ID',
          'clientSecret' => 'YOUR APP CLIENT SECRET',
          'attributeNames' => ['name', 'email', 'first_name', 'last_name'],
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download