elitedivision/amos-social-auth
Social Auth
Requires
- php:>=5.4.0
- elitedivision/amos-admin:^2.7.4
- elitedivision/amos-core:^1.23.0
- elitedivision/amos-attachments:^1.0
- hybridauth/hybridauth:^3.1.1
- firebase/php-jwt:^5.2.0
- phpseclib/phpseclib:^2.0.29
- google/apiclient:^2.0
- yiisoft/yii2-authclient:^2.1.0
- conquer/oauth2:*
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-master
- 1.12.3
- 1.12.2
- 1.12.1
- 1.12.0
- 1.11.0
- 1.10.0
- 1.9.0
- 1.8.1
- 1.8.0
- 1.7.1
- 1.7.0
- 1.6.1
- 1.6.0
- 1.5.4
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.0
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.1
- 1.2.0
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1
- 1.0
- dev-test/1.16.0/1
- dev-test/1.15.0/1
- dev-test/1.12.3
- dev-fabiano/1.14.0/1
- dev-test/1.14.0/1
- dev-test/1.12.2open
- dev-test/1.14.0/2
- dev-firebase_new
- dev-test/1.12.1open
- dev-test/1.12.1/2
- dev-test/1.10.0/1
- dev-fabiano/1.12.1/2
- dev-test/1.13.0/1
- dev-test/1.12.1/1
- dev-test/1.11.0/2
- dev-cesari/1.11.0/2
- dev-test/1.11.1/1
- dev-filippo/1.11.0/2
- dev-cesari/1.11.0/1
- dev-test/1.11.0/1
- dev-la_francesca/1.10.0
- dev-test/1.9.1/1
- dev-test/1.8.2/1
- dev-retecomuni/1.4.0
- dev-test/1.9.0/2
- dev-test/1.8.0/4
- dev-test/1.8.0/1
- dev-test/1.9.0/1
- dev-francesca/1.8.0/4
- dev-melanie/1.7.1
- dev-test/1.7.1/1
- dev-test/1.3.3/1
- dev-riccardo/1.8.0/4
- dev-test/1.3.2/1
- dev-la_francesca/poi_do_not_merge
- dev-la_francesca/1.8.0
- dev-test/1.8.0/3
- dev-test/1.7.0/4
- dev-test/1.8.0/2
- dev-la_francesca/1.7.0/3
- dev-test/1.7.0/3
- dev-test/1.6.1/2
- dev-test/1.5.4/1
- dev-test/1.3.1/1
- dev-test/1.2.1/1
- dev-test/1.1.13/1
- dev-test/1.7.0/2
- dev-test/1.6.1/1
- dev-eventi/1.6.1
- dev-test/1.7.0/1
- dev-fabiot_1.7.0
- dev-MAPPLE_FOL/1.6.0
- dev-fabiot_1.6.0
- dev-test/1.5.0
- dev-fabiot
- dev-michele.zucchini/1.6.0/1
- dev-test/1.6.0/1
- dev-michele.zucchini/1.5.0
- dev-la_francesca/1.5.0_eventi
- dev-test/1.1.14/1
- dev-la_francesca/1.5.0
- dev-fabiot_1.5.0
- dev-scarface
- dev-la_francesca/1.4.1
- dev-test/1.4.0
- dev-scarface_farmlab
- dev-la_francesca/1.4.0
- dev-la_francesca/1.3.0
- dev-test/1.3.0
- dev-lisa/GRAFICA-BI-LESS
- dev-la_francesca/wizard_event/1.2.0
- dev-michele.zucchini/1.2.0
- dev-test/1.2.0
- dev-la_francesca/wizard_event/1.1.12
- dev-open20/1.1.11/1
- dev-fabiot_fix
- dev-test/1.1.12
- dev-riccardo/1.2.0
- dev-test/1.1.11
- dev-test/1.1.10/1
- dev-test/1.1.9/1
- dev-update
- dev-POI
- dev-cruscotto_lavoro
- dev-rete_comuni
- dev-test/1.1.7/2
- dev-nuovo_login
- dev-test/1.1.7/1
- dev-la_francesca/1.1.7/1
- dev-riccardo/1.1.7/1
- dev-DEPLOY_POI_20180921
- dev-test/1.1.6/1
- dev-test/1.1.5/1
- dev-cinzia
- dev-riccardo/1.1.5/1
- dev-DEPLOY_POI_20180702
- dev-test/1.1.3/1
- dev-la_francesca/1.0/1
- dev-pivanti
README
Social Auth For Amos
Installation
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.jsonfile.Add module to your main config in common:
<?php 'modules' => [ 'socialauth' => [ 'class' => 'elitedivision\amos\socialauth\Module' ], ],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.htmlAction enable/disable
enableLoginTo alow Social LoginenableLinkTo Enable Social Account Linking (my-profile 'settings' tab)enableRegisterTo Enable Registration with SocialenableServicesTo list enabled services related to social accounts. By default the array containscalendarandcontacts
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'
Google
(guide from https://hybridauth.github.io/hybridauth/userguide/IDProvider_info_Google.html)- Go to the Google Developers Console https://console.developers.google.com/projectselector/apis/library?supportedpurview=project.
- From the project drop-down, select a project, or create a new one.
- Enable the Google API services:
In the list of Google APIs, search for the Google+ API service.
Select Google+ API from the results list.
Press the Enable API button.
The same for People API and Calendar API
- Enable API in Google console
for account and contacts: People API, Google+ API
for calendar events: Google Calendar API
- Enable API in Google console
- When the process completes, enabled APIs appears in the list of enabled APIs. To access, select API Manager on the left sidebar menu, then select the Enabled APIs tab.
- In the sidebar under "API Manager", select Credentials. In the Credentials tab, select the New credentials drop-down list, and choose OAuth client ID.
- From the Application type list, choose the Web application.
Enter a name and provide this URLs as Authorized redirect URIs: https://YourPlatformUrl/socialauth/social-auth/sign-in?action=done&provider=google
https://YourPlatformUrl/socialauth/social-auth/sign-up?action=done&provider=google
https://YourPlatformUrl/admin/user-profile/enable-google-serviceOnce you have registered, copy and past the created application credentials (Client ID and Secret) into the HybridAuth config file.