aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/service/facebook.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/service/facebook.php')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/facebook.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/service/facebook.php b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
index 4758ae11f8..16919081cc 100644
--- a/phpBB/phpbb/auth/provider/oauth/service/facebook.php
+++ b/phpBB/phpbb/auth/provider/oauth/service/facebook.php
@@ -79,4 +79,22 @@ class phpbb_auth_provider_oauth_service_facebook extends phpbb_auth_provider_oau
// Return the unique identifier returned from bitly
return $result['id'];
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Facebook))
+ {
+ // TODO: make exception class and use language constant
+ throw new Exception('Invalid service provider type');
+ }
+
+ // Send a request with it
+ $result = json_decode( $this->service_provider->request('/me'), true );
+
+ // Return the unique identifier returned from bitly
+ return $result['id'];
+ }
}