Social Login

First of all generate keys and secret as explained in tutorial How to setup Google and Facebook Connect, and then inside your configuration file add below settings and change the text in bold:

'hybridauth' => [

    'enabled' => true,

    'base_url' => 'http://your-community-domain.com/auth/redirect',

    'providers' => [

        'Facebook' => [

            'enabled' => true,

            'keys' => ['id' => 'FACEBOOK_KEY', 'secret' => 'FACEBOOK_SECRET'],

            'scope' => 'public_profile, email, user_friends, publish_actions'

        ],

        'Google' => [

            'enabled' => true,

            'keys' => ['id' => 'GOOGLE_KEY', 'secret' => 'GOOGLE_SECRET'],

            'scope' => 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read https://www.google.com/m8/feeds/'

        ]

    ]

],
  • base_url: add here your domain name, example https://socialveo.co/auth/redirect
  • keys: replace FACEBOOK_KEY with the Facebook key and the same for FACEBOOK_SECRET, GOOGLE_KEY and GOOGLE_SECRET
  • if you want to enable only Facebook or only Google, then remove from providers the configuration block, example if you want to use only Facebook:
'hybridauth' => [

    'enabled' => true,

    'base_url' => 'http://your-community-domain.com/auth/redirect',

    'providers' => [

        'Facebook' => [

            'enabled' => true,

            'keys' => ['id' => 'FACEBOOK_KEY', 'secret' => 'FACEBOOK_SECRET'],

            'scope' => 'public_profile, email, user_friends, publish_actions'

        ]

    ]

],

Was this article helpful?

Related Articles

Leave A Comment?

You must be logged in to post a comment.