From e8d0777203292372b04114ce835dbcdbaef68168 Mon Sep 17 00:00:00 2001 From: cristiano <cristiano.urban@inaf.it> Date: Mon, 19 Aug 2024 10:17:27 +0200 Subject: [PATCH] Removed support to Facebook. Signed-off-by: cristiano <cristiano.urban@inaf.it> --- README.md | 3 +-- classes/model/AuthPageModel.php | 4 ---- classes/model/AuthenticationMethods.php | 2 -- classes/model/Identity.php | 5 ++--- composer.json | 1 - config-example.yaml | 11 +++-------- docker/demo-config.yaml | 2 +- include/front-controller.php | 14 -------------- js/admin.js | 4 ++-- views/admin/index.php | 3 --- views/main-page.php | 7 +------ 11 files changed, 10 insertions(+), 46 deletions(-) diff --git a/README.md b/README.md index a4e3e8a..af440de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Remote Authentication Portal -An authentication portal supporting eduGAIN (using Shibboleth SP), social logins (Google, LinkedIn and Facebook) and X.509 certificates. Caller services always see an OIDC flow. Account linking and merging is supported. Currently used for authenticating on [IA2 services](https://sso.ia2.inaf.it). +An authentication portal supporting eduGAIN (using Shibboleth SP), social logins (Google, LinkedIn) and X.509 certificates. Caller services always see an OIDC flow. Account linking and merging is supported. Currently used for authenticating on [IA2 services](https://sso.ia2.inaf.it). ## Docker demo @@ -61,7 +61,6 @@ Before using social API it is necessary to register an application on each socia * https://console.developers.google.com * https://www.linkedin.com/developer/apps -* https://developers.facebook.com/apps ### Configuration file diff --git a/classes/model/AuthPageModel.php b/classes/model/AuthPageModel.php index 8aaabc4..ee5bca4 100644 --- a/classes/model/AuthPageModel.php +++ b/classes/model/AuthPageModel.php @@ -18,7 +18,6 @@ class AuthPageModel { public $orcid; public $x509; public $google; - public $facebook; public $linkedIn; public $localIdP; public $test; @@ -57,9 +56,6 @@ class AuthPageModel { $this->google = isset($config->authenticationMethods->Google) && in_array(AuthenticationMethods::GOOGLE, $client->authMethods); - $this->facebook = isset($config->authenticationMethods->Facebook) && - in_array(AuthenticationMethods::FACEBOOK, $client->authMethods); - $this->linkedIn = isset($config->authenticationMethods->LinkedIn) && in_array(AuthenticationMethods::LINKED_IN, $client->authMethods); diff --git a/classes/model/AuthenticationMethods.php b/classes/model/AuthenticationMethods.php index f952e67..97560c0 100644 --- a/classes/model/AuthenticationMethods.php +++ b/classes/model/AuthenticationMethods.php @@ -15,7 +15,6 @@ abstract class AuthenticationMethods { const X509 = "X.509"; const GOOGLE = "Google"; const LINKED_IN = "LinkedIn"; - const FACEBOOK = "Facebook"; const LOCAL_IDP = "LocalIdP"; public static function getAllMethods() { @@ -25,7 +24,6 @@ abstract class AuthenticationMethods { AuthenticationMethods::X509, AuthenticationMethods::GOOGLE, AuthenticationMethods::LINKED_IN, - AuthenticationMethods::FACEBOOK, AuthenticationMethods::LOCAL_IDP ]; } diff --git a/classes/model/Identity.php b/classes/model/Identity.php index c480e41..4c21dbf 100644 --- a/classes/model/Identity.php +++ b/classes/model/Identity.php @@ -16,11 +16,10 @@ class Identity { const EDU_GAIN = "eduGAIN"; const X509 = "X.509"; const GOOGLE = "Google"; - const FACEBOOK = "Facebook"; const LINKEDIN = "LinkedIn"; const ORCID = "OrcID"; - private static $ALLOWED_TYPES = [Identity::EDU_GAIN, Identity::X509, Identity::GOOGLE, Identity::FACEBOOK, Identity::LINKEDIN, Identity::ORCID]; + private static $ALLOWED_TYPES = [Identity::EDU_GAIN, Identity::X509, Identity::GOOGLE, Identity::LINKEDIN, Identity::ORCID]; /** * Identity id in the database. Mandatory field. @@ -34,7 +33,7 @@ class Identity { /** * Data related to specific account type (shibboleth persistent id, - * facebook id, certificate serial number, etc, ...). Mandatory field. + * certificate serial number, etc, ...). Mandatory field. */ public $typedId; diff --git a/composer.json b/composer.json index 6bebc79..827a1b8 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,6 @@ "require": { "mikecao/flight": "1.3.7", "google/apiclient": "2.1.3", - "facebook/graph-sdk": "^5.5", "monolog/monolog": "^1.22" }, "require-dev": { diff --git a/config-example.yaml b/config-example.yaml index a4d61ae..13756db 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -20,11 +20,6 @@ authenticationMethods: id: "XXXXXX" secret: "XXXXXX" callback: "/auth/social/google" - Facebook: - id: "XXXXXX" - secret: "XXXXXX" - version: "v8.0" - callback: "/auth/social/facebook/token" LinkedIn: id: "XXXXXX" secret: "XXXXXX" @@ -60,7 +55,7 @@ clients: home: http://localhost:8082/gms icon: showInHome: true - methods: [eduGAIN, Google, Facebook, LinkedIn, X.509, LocalIdP] + methods: [eduGAIN, Google, LinkedIn, X.509, LocalIdP] - label: "Asiago Astrophysical Observatory (localhost)" id: aao-dev secret: 2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea @@ -69,9 +64,9 @@ clients: home: http://localhost:8081/aao icon: asiago.gif showInHome: true - methods: [eduGAIN, Google, Facebook, LinkedIn, X.509, LocalIdP] + methods: [eduGAIN, Google, LinkedIn, X.509, LocalIdP] cliClients: - id: gms_cli secret: 2a97516c354b68848cdbd8f54a226a0a55b21ed138e207ad6c5cbb9c00aa5aea scope: "read:gms write:gms read:rap" - audience: [gms] \ No newline at end of file + audience: [gms] diff --git a/docker/demo-config.yaml b/docker/demo-config.yaml index 2ad850e..517f976 100644 --- a/docker/demo-config.yaml +++ b/docker/demo-config.yaml @@ -40,7 +40,7 @@ clients: home: http://localhost:8081/gms icon: showInHome: true - methods: [eduGAIN, Google, Facebook, LinkedIn, X.509, LocalIdP] + methods: [eduGAIN, Google, LinkedIn, X.509, LocalIdP] cliClients: - id: rap_cli diff --git a/include/front-controller.php b/include/front-controller.php index 7cee157..b3eb3cd 100644 --- a/include/front-controller.php +++ b/include/front-controller.php @@ -173,20 +173,6 @@ Flight::route('/auth/social/google', function() { } }); -Flight::route('/auth/social/facebook', function() { - session_start(); - global $locator; - $facebookLogin = new \RAP\FacebookLogin($locator); - Flight::redirect($facebookLogin->login()); -}); - -Flight::route('/auth/social/facebook/token', function() { - session_start(); - global $locator; - $facebookLogin = new \RAP\FacebookLogin($locator); - Flight::redirect($facebookLogin->retrieveToken()); -}); - Flight::route('/auth/social/linkedIn', function() { session_start(); global $locator; diff --git a/js/admin.js b/js/admin.js index d07d56d..f819c3a 100644 --- a/js/admin.js +++ b/js/admin.js @@ -1,6 +1,6 @@ (function () { - var AUTH_METHODS = ['eduGAIN', 'Google', 'Facebook', 'LinkedIn', 'X.509', 'LocalIdP']; + var AUTH_METHODS = ['eduGAIN', 'Google', 'LinkedIn', 'X.509', 'LocalIdP']; var vm = new Vue({ el: '#admin-vue', @@ -159,4 +159,4 @@ hideWaiting(); }); -})(); \ No newline at end of file +})(); diff --git a/views/admin/index.php b/views/admin/index.php index e9d7891..960bae2 100644 --- a/views/admin/index.php +++ b/views/admin/index.php @@ -102,9 +102,6 @@ include 'include/header.php'; <label> <input type="checkbox" v-model="client.authMethods['Google']"> Google </label> - <label> - <input type="checkbox" v-model="client.authMethods['Facebook']"> Facebook - </label> <label> <input type="checkbox" v-model="client.authMethods['LinkedIn']"> LinkedIn </label> diff --git a/views/main-page.php b/views/main-page.php index 5d2207c..5794889 100644 --- a/views/main-page.php +++ b/views/main-page.php @@ -36,7 +36,7 @@ include 'include/header.php'; Use the eduGAIN or OrcID Logo to Login or Register to RAP facility with your Institutional account. </div> <?php } ?> - <?php if ($model->google || $model->facebook || $model->linkedIn) { ?> + <?php if ($model->google || $model->linkedIn) { ?> <div class="home-box"> <div class="img-wrapper"> <?php if ($model->google) { ?> @@ -44,11 +44,6 @@ include 'include/header.php'; <img src="img/google-60.png" alt="Google Logo" /> </a> <?php } ?> - <?php if ($model->facebook) { ?> - <a href="auth/social/facebook"> - <img src="img/facebook-60.png" alt="Facebook Logo" /> - </a> - <?php } ?> <?php if ($model->linkedIn) { ?> <a href="auth/social/linkedin"> <img src="img/linkedin-60.png" alt="LinkedIn Logo" /> -- GitLab