diff --git a/Classes/Service/SocialAuthenticationService.php b/Classes/Service/SocialAuthenticationService.php index caa065c..48d0dec 100755 --- a/Classes/Service/SocialAuthenticationService.php +++ b/Classes/Service/SocialAuthenticationService.php @@ -73,7 +73,8 @@ class SocialAuthenticationService extends AbstractAuthenticationService 'facebook' => 1, 'google' => 2, 'twitter' => 3, - 'linkedin' => 4 + 'linkedin' => 4, + 'instagram' => 5, ]; /** diff --git a/Classes/Utility/AuthUtility.php b/Classes/Utility/AuthUtility.php index ff999ca..4c2464a 100755 --- a/Classes/Utility/AuthUtility.php +++ b/Classes/Utility/AuthUtility.php @@ -4,6 +4,7 @@ use TYPO3\CMS\Core\Configuration\ExtensionConfiguration; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\HttpUtility; +use TYPO3\CMS\Core\Utility\ExtensionManagementUtility; /*************************************************************** * @@ -96,6 +97,18 @@ public function initializeObject() 'id' => $this->extConfig['providers']['linkedin']['keys']['key'], 'secret' => $this->extConfig['providers']['linkedin']['keys']['secret'] ) + ), + 'Instagram' => array( + 'enabled' => $this->extConfig['providers']['instagram']['enabled'], + 'keys' => array( + 'id' => $this->extConfig['providers']['instagram']['keys']['id'], + 'secret' => $this->extConfig['providers']['instagram']['keys']['secret'] + ), + 'scope' => $this->extConfig['providers']['instagram']['scope'], + 'wrapper' => array( + 'class' => 'Hybrid_Providers_Instagram', + 'path' => ExtensionManagementUtility::extPath('social_auth').'Resources/Private/Librairies/hybridauth/hybridauth/additional-providers/hybridauth-instagram/Providers/Instagram.php' + ) ) ), 'debug_mode' => false, diff --git a/Configuration/TCA/Overrides/fe_users.php b/Configuration/TCA/Overrides/fe_users.php index 2363575..93490b2 100755 --- a/Configuration/TCA/Overrides/fe_users.php +++ b/Configuration/TCA/Overrides/fe_users.php @@ -3,7 +3,6 @@ die('Access denied.'); } - /** * Add extra fields to the fe_users */ @@ -19,7 +18,8 @@ array('Facebook', 1), array('Google', 2), array('Twitter', 3), - array('LinkedIn', 4) + array('LinkedIn', 4), + array('Instagram', 5), ), 'size' => 1, 'maxitems' => 1, diff --git a/Configuration/TypoScript/setup.typoscript b/Configuration/TypoScript/setup.typoscript index d4e99aa..edf6b39 100755 --- a/Configuration/TypoScript/setup.typoscript +++ b/Configuration/TypoScript/setup.typoscript @@ -86,6 +86,11 @@ plugin.tx_felogin_pi1{ typolink.ATagParams = class="btn btn-block btn-social btn-linkedin" rel="nofollow" stdWrap.dataWrap = {LLL:EXT:social_auth/Resources/Private/Language/locallang.xlf:linkedin.label} } + instagram < .facebook + instagram{ + typolink.ATagParams = class="btn btn-block btn-social btn-instagram" rel="nofollow" + stdWrap.dataWrap = {LLL:EXT:social_auth/Resources/Private/Language/locallang.xlf:instagram.label} + } } } diff --git a/Documentation/UsersManual/Index.rst b/Documentation/UsersManual/Index.rst index 2354240..6dec622 100644 --- a/Documentation/UsersManual/Index.rst +++ b/Documentation/UsersManual/Index.rst @@ -12,7 +12,7 @@ Users manual ============ - Install the extension using the Extension Manager -- Register new app on Facebook, Twitter, Google or LinkedIn and follow the instructions. Some examples are detailed on Hybrid auth user guide [http://hybridauth.sourceforge.net/userguide.html] +- Register new app on Facebook, Twitter, Google, LinkedIn or Instagram and follow the instructions. Some examples are detailed on Hybrid auth user guide [http://hybridauth.sourceforge.net/userguide.html] - Configure via Extension Manager and add key + appId for each social provider & set options for fe_users creation (users pid and default usergroup id are required !) - Storage User Pid should be different from classic fe_users PID to prevent unique username - Add the static TS (typoscript) to your typoscript template diff --git a/README.md b/README.md index 511af78..0a1dc2b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Social Auth service for TYPO3 with Hybrid Auth API (Facebook, Twitter, Google + ## Installation instructions * Install the extension using the Extension Manager -* Register new app on Facebook, Twitter, Google or LinkedIn and follow the instructions. Some examples are detailed on Hybrid auth user guide [http://hybridauth.sourceforge.net/userguide.html] +* Register new app on Facebook, Twitter, Google, LinkedIn or Instagram and follow the instructions. Some examples are detailed on Hybrid auth user guide [http://hybridauth.sourceforge.net/userguide.html] * Configure via Extension Manager and add key + appId for each social provider & set options for fe_users creation (users pid and default usergroup id are required !) * Storage User Pid should be different from classic fe_users PID to prevent unique username * New for 8.7 instance, set file storage uid and path for fe_users.image (FAL is used now for image field) diff --git a/Resources/Private/Language/locallang.xlf b/Resources/Private/Language/locallang.xlf index 97561a0..ae17a36 100644 --- a/Resources/Private/Language/locallang.xlf +++ b/Resources/Private/Language/locallang.xlf @@ -17,6 +17,9 @@ Sign in with LinkedIn + + + Sign in with Instagram diff --git a/composer.json b/composer.json index 799a9cf..6acf77b 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "kalypso63/social_auth", "type": "typo3-cms-extension", - "description": "Authentification via social auth (Facebook, Twitter, Google + & LinkedIn)", + "description": "Authentication via social auth (Facebook, Twitter, Google +, LinkedIn & Instagram)", "authors": [ { "name": "VANCLOOSTER Mickael", diff --git a/ext_conf_template.txt b/ext_conf_template.txt index afbc45e..425c1bc 100755 --- a/ext_conf_template.txt +++ b/ext_conf_template.txt @@ -43,6 +43,18 @@ providers.linkedin.keys.key = # cat=LinkedIn/2; type=string; label=LinkedIn Secret providers.linkedin.keys.secret = +# cat=Instagram/0; type=boolean; label=Instagram enable : Enable Single Sign On via Instagram for this System +providers.instagram.enabled = 0 + +# cat=Instagram/1; type=string; label=Instagram Client Id +providers.instagram.keys.id = + +# cat=Instagram/2; type=string; label=Instagram Client Secret +providers.instagram.keys.secret = + +# cat=Instagram/3; type=string; label=Scope of get attributes +providers.instagram.scope = basic + # cat=Storage users/O; type=int; label= Storage Pid : The Storage Pid of the Page, where the fe_users should be stored users.storagePid = diff --git a/ext_emconf.php b/ext_emconf.php index 403d680..ac62d54 100755 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -12,7 +12,7 @@ $EM_CONF[$_EXTKEY] = array( 'title' => 'Social auth', - 'description' => 'Authentification via social auth (Facebook, Twitter, Google + & LinkedIn)', + 'description' => 'Authentication via social auth (Facebook, Twitter, Google +, LinkedIn & Instagram)', 'category' => 'plugin', 'author' => 'VANCLOOSTER Mickael', 'author_email' => 'vanclooster.mickael@gmail.com', diff --git a/ext_localconf.php b/ext_localconf.php index abe921e..37517cf 100755 --- a/ext_localconf.php +++ b/ext_localconf.php @@ -22,7 +22,7 @@ $extConfig = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance( \TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class )->get('social_auth'); - if ($extConfig['providers']['facebook']['enabled'] || $extConfig['providers']['google']['enabled'] || $extConfig['providers']['twitter']['enabled']) { + if ($extConfig['providers']['facebook']['enabled'] || $extConfig['providers']['google']['enabled'] || $extConfig['providers']['twitter']['enabled'] || $extConfig['providers']['instagram']['enabled']) { $GLOBALS['TYPO3_CONF_VARS']['SVCONF']['auth']['setup']['FE_fetchUserIfNoSession'] = true; $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_post_processing'][$_EXTKEY] = 'MV\SocialAuth\Hooks\LogOffHook->postProcessing'; }