diff --git a/src/ResponseTypes/JsonWebTokenType.php b/src/ResponseTypes/JsonWebTokenType.php deleted file mode 100644 index 7ea5051a..00000000 --- a/src/ResponseTypes/JsonWebTokenType.php +++ /dev/null @@ -1,125 +0,0 @@ - $this->accessToken->getIdentifier(), - 'token_type' => 'Bearer', - 'expires_in' => $this->accessToken->getExpiryDateTime()->getTimestamp() - (new \DateTime())->getTimestamp() - ]; - - if (!is_null($this->getParam('refresh_token'))) { - $return['refresh_token'] = $this->getParam('refresh_token'); - } - - $return['id_token'] = $this->generateJWT(); - - return $return; - } - - /** - * Generate an JWT - * @return string - */ - public function generateJWT() - { - $now = new \DateTime(); - - $token = [ - 'iss' => self::$issuer, - 'aud' => self::$audience, - 'sub' => $this->accessToken->getOwnerIdentifier(), - 'exp' => $this->accessToken->getExpiryDateTime()->getTimestamp(), - 'nbf' => $now->getTimestamp(), - 'iat' => $now->getTimestamp(), - 'jti' => SecureKey::generate() - ]; - - return JWT::encode($token, self::$encryptionKey); - } - - /** - * @return \Symfony\Component\HttpFoundation\Response - */ - public function generateHttpResponse() - { - return new Response( - json_encode([ - $this->generateResponse() - ]), - 200, - [ - 'Content-type' => 'application/json', - 'Cache-Control' => 'no-store', - 'Pragma' => 'no-cache' - ] - ); - } - - /** - * Determine the access token in the authorization header - * - * @param \Symfony\Component\HttpFoundation\Request $request - * - * @return string - */ - public function determineAccessTokenInHeader(Request $request) - { - // TODO: Implement determineAccessTokenInHeader() method. - } -}