diff --git a/src/OAuth2/AuthServer.php b/src/OAuth2/AuthServer.php index 9008d829..62c42b9e 100644 --- a/src/OAuth2/AuthServer.php +++ b/src/OAuth2/AuthServer.php @@ -2,6 +2,10 @@ namespace OAuth2; +use OAuth2\Storage\SessionInterface; +use OAuth2\Storage\ClientInterface; +use OAuth2\Storage\ScopeInterface; + class AuthServer { protected $scopeDelimeter = ','; @@ -18,9 +22,14 @@ class AuthServer protected $request = null; - public function __construct($storage) - { + public function __construct(ClientInterface $client, SessionInterface $session, ScopeInterface $scope) + { + $this->storages = array( + 'client' => $client, + 'session' => $session, + 'scope' => $scope + ); } public function addGrantType(GrantTypeInterface $grant_type, $identifier = null) @@ -75,6 +84,11 @@ class AuthServer return $this->request; } + public function getStorage($obj) + { + return $this->storages[$obj]; + } + /** * Check client authorise parameters *