lispa/amos-social-auth

There is no license information available for the latest version (1.12.2) of this package.

Social Auth


README

Social Auth For Amos

Installation

  1. The preferred way to install this extension is through composer.

    Either run

    composer require open20/amos-social-auth

    or add

    "open20/amos-social-auth": "~1.0"
    

    to the require section of your composer.json file.

  2. Add module to your main config in common:

    <?php
    'modules' => [
        'socialauth' => [
            'class' => 'open20\amos\socialauth\Module'
        ],
    ],
  3. Apply migrations

    php yii migrate/up --migrationPath=@vendor/open20/amos-social-auth/src/migrations

Configuration

  • Sample configuration

    <?php
        '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',
                        "includeEmail" => true
                    ],
                    "Google" => [
                        "enabled" => true,
                        "keys" => [
                            "id" => "",
                            "secret" => ""
                        ],
                        "scope" => 'email',
                        "includeEmail" => true
                    ],
                ]
            ],
        ],

    see configuration doc: https://hybridauth.github.io/hybridauth/userguide/Configuration.html

  • Action enable/disable

    • enableLogin To alow Social Login
    • enableLink To Enable Social Account Linking (my-profile 'settings' tab)
    • enableRegister To Enable Registration with Social
    • enableServices To list enabled services related to social accounts. By default the array contains calendar and contacts

The provider linking functionality is managed in 'My Profile', amos-admin. To enable social links check in admin configuraion the visibility for box social-accounts and for the the providers buttons.

$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'],
                    .
                    .
                    .
                ]
            ]
        ];

Providers

Providers configuration doc: https://hybridauth.github.io/hybridauth/userguide.html section 'Popular Providers'