aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/auth/provider/oauth.php
diff options
context:
space:
mode:
authorJoseph Warner <hardolaf@hardolaf.com>2013-07-13 13:08:37 -0400
committerJoseph Warner <hardolaf@hardolaf.com>2013-07-14 14:22:42 -0400
commit93f7ed4fb55daf3ca06957f4374cb827db06432c (patch)
tree7bdf989ca32b9bffd275bf60a548a980cb67994b /phpBB/includes/auth/provider/oauth.php
parent2e899c24f9248a06eef7b8cfaed7f5b4a792f7fd (diff)
downloadforums-93f7ed4fb55daf3ca06957f4374cb827db06432c.tar
forums-93f7ed4fb55daf3ca06957f4374cb827db06432c.tar.gz
forums-93f7ed4fb55daf3ca06957f4374cb827db06432c.tar.bz2
forums-93f7ed4fb55daf3ca06957f4374cb827db06432c.tar.xz
forums-93f7ed4fb55daf3ca06957f4374cb827db06432c.zip
[feature/oauth] Continue work on OAuth login
PHPBB3-11673
Diffstat (limited to 'phpBB/includes/auth/provider/oauth.php')
-rw-r--r--phpBB/includes/auth/provider/oauth.php51
1 files changed, 44 insertions, 7 deletions
diff --git a/phpBB/includes/auth/provider/oauth.php b/phpBB/includes/auth/provider/oauth.php
index cbb1d99004..4cf9749b36 100644
--- a/phpBB/includes/auth/provider/oauth.php
+++ b/phpBB/includes/auth/provider/oauth.php
@@ -26,19 +26,56 @@ use OAuth\Common\Http\Uri\Uri;
class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
{
/**
+ * Database driver
+ *
+ * @var phpbb_db_driver
+ */
+ protected $db;
+
+ /**
+ * phpBB config
+ *
+ * @var phpbb_config
+ */
+ protected $config;
+
+ /**
+ * phpBB request object
+ *
+ * @var phpbb_request
+ */
+ protected $request;
+
+ /**
+ * phpBB user
+ *
+ * @var phpbb_user
+ */
+ protected $user;
+
+ /**
+ * Cache driver.
+ *
+ * @var phpbb_cache_driver_interface
+ */
+ protected $driver;
+
+ /**
* OAuth Authentication Constructor
*
- * @param phpbb_db_driver $db
- * @param phpbb_config $config
- * @param phpbb_request $request
- * @param phpbb_user $user
+ * @param phpbb_db_driver $db
+ * @param phpbb_config $config
+ * @param phpbb_request $request
+ * @param phpbb_user $user
+ * @param phpbb_cache_driver_interface $driver
*/
- public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user)
+ public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, phpbb_cache_driver_interface $driver)
{
$this->db = $db;
$this->config = $config;
$this->request = $request;
$this->user = $user;
+ $this->driver = $driver;
}
/**
@@ -72,11 +109,11 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
$service_factory = new \OAuth\ServiceFactory();
$uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
- $current_uri = $uri_factory->createFromSuperGlobalArray((array)$_SERVER);
+ $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(phpbb_request_interface::SERVER));
$current_uri->setQuery('');
// In-memory storage
- $storage = new Memory();
+ $storage = new phpbb_auth_oauth_token_storage($this->driver);
// Setup the credentials for the requests
$credentials = new Credentials(