aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/facebook.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
index 87e8749b55..fcf41755b7 100644
--- a/phpBB/phpbb/auth/provider/oauth/service/facebook.php
+++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
@@ -49,4 +49,25 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
'secret' => $this->config['auth_oauth_facebook_secret'],
);
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_auth_login()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ // TODO: make exception class and use language constant
+ throw new Exception('Invalid service provider type');
+ }
+
+ // This was a callback request from bitly, get the token
+ $this->service_provider->requestAccessToken( $this->request->variable('code', '') );
+
+ // Send a request with it
+ $result = json_decode( $this->service_provider->request('/me'), true );
+
+ // Return the unique identifier returned from bitly
+ return $result['id'];
+ }
}