public function fetchAccessToken($code)
    {
        $this->validateTokenParams();

        $this->oauth2->tokenUrl = $this->tokenUrl;
        $this->oauth2->clientId = $this->clientId;
        $this->oauth2->clientSecret = $this->clientSecret;

        try {
            $response = $this->oauth2->fetchAccessToken($code);
        } catch (Exception $ex) {
            throw new Oauth2ClientException($ex->getMessage());
        }
        return $this->handleTokenResponse($response);
    }