arter/amos-social-auth

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

Social Auth

1.3.3 2022-05-04 16:00 UTC

This package is auto-updated.

Last update: 2024-04-16 19:45:11 UTC


README

Social Auth For Amos

Installation

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

    Either run

     composer require arter/amos-social-auth
    

    or add

     "arter/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' => 'arter\amos\socialauth\Module'
        ],
    ],
    
  3. Apply migrations

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

Configuration

  • Sample configuration

      <?php
          'modules' => [
              'socialauth' => [
                  'class' => 'arter\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' => 'arter\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'