PHP code example of open20 / amos-social-auth
1. Go to this page and download the library: Download open20/amos-social-auth library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
open20 / amos-social-auth example snippets
'modules' => [
'socialauth' => [
'class' => 'open20\amos\socialauth\Module'
],
],
'modules' => [
'socialauth' => [
'class' => 'open20\amos\socialauth\Module',
'enableLogin' => true,
'enableLink' => false,
'enableRegister' => false,
'providers' => [
"Facebook" => [
"enabled" => true,
"keys" => [
"id" => "",
"secret" => ""
],
"scope" => "email"
],
"Twitter" => [
"enabled" => true,
"keys" => [
"key" => "",
"secret" => ""
],
"scope" => 'email',
"
$modules['admin'] = [
'class' => 'open20\amos\admin\AmosAdmin',
'enableRegister' => true,
'fieldsConfigurations' => [
'boxes' => [
.
.
.
'box_social_account' => ['form' => true, 'view' => true],
],
'fields' => [
.
.
.
'facebook' => ['form' => true, 'view' => true, 'referToBox' => 'box_social_account'],
'google' => ['form' => true, 'view' => true, 'referToBox' => 'box_social_account'],
'linkedin' => ['form' => true, 'view' => true, 'referToBox' => 'box_social_account'],
'twitter' => ['form' => true, 'view' => true, 'referToBox' => 'box_social_account'],
.
.
.
]
]
];
bash
php yii migrate/up --migrationPath=@vendor/open20/amos-social-auth/src/migrations