aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/service
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-18 16:03:29 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-18 16:03:44 -0400
commit772a977afcd4919c9d8bfcc8e402f4af4d3aefbf (patch)
tree8f3d70bd0d91e27ff591fa6728acebfbd5b995c9 /phpBB/phpbb/auth/provider/oauth/service
parent2eb47d00e078cf7b0dd3a12e2557a33ca89d297a (diff)
downloadforums-772a977afcd4919c9d8bfcc8e402f4af4d3aefbf.tar
forums-772a977afcd4919c9d8bfcc8e402f4af4d3aefbf.tar.gz
forums-772a977afcd4919c9d8bfcc8e402f4af4d3aefbf.tar.bz2
forums-772a977afcd4919c9d8bfcc8e402f4af4d3aefbf.tar.xz
forums-772a977afcd4919c9d8bfcc8e402f4af4d3aefbf.zip
[feature/oauth] Facebook support
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/service')
-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'];
+ }
}