diff --git a/src/League/OAuth2/Server/Grant/Implicit.php b/src/League/OAuth2/Server/Grant/Implicit.php deleted file mode 100644 index 33eb3491..00000000 --- a/src/League/OAuth2/Server/Grant/Implicit.php +++ /dev/null @@ -1,90 +0,0 @@ - - * @copyright Copyright (c) PHP League of Extraordinary Packages - * @license http://mit-license.org/ - * @link http://github.com/php-loep/oauth2-server - */ - -namespace League\OAuth2\Server\Grant; - -use League\OAuth2\Server\Request; -use League\OAuth2\Server\Authorization; -use League\OAuth2\Server\Exception; -use League\OAuth2\Server\Util\SecureKey; -use League\OAuth2\Server\Storage\SessionInterface; -use League\OAuth2\Server\Storage\ClientInterface; -use League\OAuth2\Server\Storage\ScopeInterface; - -/** - * Client credentials grant class - */ -class Implicit implements GrantTypeInterface { - - use GrantTrait; - - /** - * Grant identifier - * @var string - */ - protected $identifier = 'implicit'; - - /** - * Response type - * @var string - */ - protected $responseType = 'token'; - - /** - * AuthServer instance - * @var AuthServer - */ - protected $authServer = null; - - /** - * Access token expires in override - * @var int - */ - protected $accessTokenTTL = null; - - /** - * Complete the client credentials grant - * @return array - */ - public function completeFlow() - { - // Remove any old sessions the user might have - $this->authServer->getStorage('session')->deleteSession($authParams['client_id'], 'user', $authParams['user_id']); - - // Generate a new access token - $accessToken = SecureKey::make(); - - // Compute expiry time - $accessTokenExpiresIn = ($this->accessTokenTTL !== null) ? $this->accessTokenTTL : $this->authServer->getAccessTokenTTL(); - $accessTokenExpires = time() + $accessTokenExpiresIn; - - // Create a new session - $sessionId = $this->authServer->getStorage('session')->createSession($authParams['client_id'], 'user', $authParams['user_id']); - - // Create an access token - $accessTokenId = $this->authServer->getStorage('session')->associateAccessToken($sessionId, $accessToken, $accessTokenExpires); - - // Associate scopes with the access token - foreach ($authParams['scopes'] as $scope) { - $this->authServer->getStorage('session')->associateScope($accessTokenId, $scope['id']); - } - - $response = array( - 'access_token' => $accessToken, - 'token_type' => 'Bearer', - 'expires' => $accessTokenExpires, - 'expires_in' => $accessTokenExpiresIn, - ); - - return $response; - } - -}