aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/auth/provider/oauth/service/bitly.php
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-29 16:07:11 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-29 16:07:26 -0400
commitd21ab4f629342d9f1bb46f489f166c9016ebe72b (patch)
tree9953a9c07476fe7cf7f4045ca683891cb7980272 /phpBB/phpbb/auth/provider/oauth/service/bitly.php
parent3d55e5faa91f0161bc020720a81b50171b30f49d (diff)
downloadforums-d21ab4f629342d9f1bb46f489f166c9016ebe72b.tar
forums-d21ab4f629342d9f1bb46f489f166c9016ebe72b.tar.gz
forums-d21ab4f629342d9f1bb46f489f166c9016ebe72b.tar.bz2
forums-d21ab4f629342d9f1bb46f489f166c9016ebe72b.tar.xz
forums-d21ab4f629342d9f1bb46f489f166c9016ebe72b.zip
[feature/oauth] Update the OAuth service interface
PHPBB3-11673
Diffstat (limited to 'phpBB/phpbb/auth/provider/oauth/service/bitly.php')
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/bitly.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
index b6b99c0850..9b8e7ebb03 100644
--- a/phpBB/phpbb/auth/provider/oauth/service/bitly.php
+++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
@@ -79,4 +79,22 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
// Return the unique identifier returned from bitly
return $result['data']['login'];
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function perform_token_auth()
+ {
+ if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
+ {
+ // 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('user/info'), true );
+
+ // Return the unique identifier returned from bitly
+ return $result['data']['login'];
+ }
}