elitedivision/amos-social-auth

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

Social Auth

1.12.2 2024-04-18 17:01 UTC

README

Social Auth For Amos

Installation

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

    Either run

    `bash composer require elitedivision/amos-social-auth `

    or add

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

    `bash php yii migrate/up --migrationPath=@vendor/elitedivision/amos-social-auth/src/migrations `

Configuration

  • Sample configuration `php <?php

      'modules' => [
          'socialauth' => [
              'class' => 'elitedivision\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' => 'elitedivision\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'