Returns the response from the Oauth callback.
@throws InvalidArugmentException
@return array The response
183982
protected function getOpauthResponse() {
		$config = OpauthAuthenticator::get_opauth_config();
		$transportMethod = $config['callback_transport'];
		switch($transportMethod) {
			case 'session':
				return $this->getResponseFromSession();
			case 'get':
			case 'post':
				return $this->getResponseFromRequest($transportMethod);
			default:
				throw new InvalidArgumentException('Invalid transport method: ' . $transportMethod);
		}
	}
43505
public function getAccessToken() 
    {
        $result = null;
        $options = $this->config->getAccessTokenConfiguration();
        $token = $this->getResponse('/oauth/token', $options);
        if (isset($token['access_token'])) {
            $this->config->setBearer($token['access_token']);
        }else {
            echo 'ERROR: no access token in API response';
        }
    }
108738
private function call()
    {
        // Process the signature
        $this->processSignature($this->client);

        try {
            // Make the request using guzzle
            $response = $this->client->send($this->request);
        } catch (\Exception $ex) {
            return $ex->getResponse();
        }

        return $response;
    }
466472
public function getResponse() {

		$params = array();
		foreach ($this->parameters as $var => $value)
		{
			if(is_array($value))
			{
				foreach($value as $v)
				{
					$params[] = $var.'='.$this->__customUrlEncode($v);
				}
			}
			else
			{
				$params[] = $var.'='.$this->__customUrlEncode($value);
			}
		}

		sort($params, SORT_STRING);

		// must be in format 'Sun, 06 Nov 1994 08:49:37 GMT'
		$date = gmdate('D, d M Y H:i:s e');

		$query = implode('&', $params);

		$headers = array();
		$headers[] = 'Date: '.$date;
		$headers[] = 'Host: '.$this->ses->getHost();

		$auth = 'AWS3-HTTPS AWSAccessKeyId='.$this->ses->getAccessKey();
		$auth .= ',Algorithm=HmacSHA256,Signature='.$this->__getSignature($date);
		$headers[] = 'X-Amzn-Authorization: '.$auth;

		$url = 'https://'.$this->ses->getHost().'/';

		// Basic setup
		$curl = curl_init();
		curl_setopt($curl, CURLOPT_USERAGENT, 'SimpleEmailService/php');

		curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, ($this->ses->verifyHost() ? 1 : 0));
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, ($this->ses->verifyPeer() ? 1 : 0));

		// Request types
		switch ($this->verb) {
			case 'GET':
				$url .= '?'.$query;
				break;
			case 'POST':
				curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $this->verb);
				curl_setopt($curl, CURLOPT_POSTFIELDS, $query);
				$headers[] = 'Content-Type: application/x-www-form-urlencoded';
			break;
			case 'DELETE':
				$url .= '?'.$query;
				curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
			break;
			default: break;
		}
		curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
		curl_setopt($curl, CURLOPT_HEADER, false);

		curl_setopt($curl, CURLOPT_URL, $url);
		curl_setopt($curl, CURLOPT_RETURNTRANSFER, false);
		curl_setopt($curl, CURLOPT_WRITEFUNCTION, array(&$this, '__responseWriteCallback'));
		curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);

		// Execute, grab errors
		if (curl_exec($curl)) {
			$this->response->code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
		} else {
			$this->response->error = array(
				'curl' => true,
				'code' => curl_errno($curl),
				'message' => curl_error($curl),
				'resource' => $this->resource
			);
		}

		@curl_close($curl);

		// Parse body into XML
		if ($this->response->error === false && isset($this->response->body)) {
			$this->response->body = simplexml_load_string($this->response->body);

			// Grab SES errors
			if (!in_array($this->response->code, array(200, 201, 202, 204))
				&& isset($this->response->body->Error)) {
				$error = $this->response->body->Error;
				$output = array();
				$output['curl'] = false;
				$output['Error'] = array();
				$output['Error']['Type'] = (string)$error->Type;
				$output['Error']['Code'] = (string)$error->Code;
				$output['Error']['Message'] = (string)$error->Message;
				$output['RequestId'] = (string)$this->response->body->RequestId;

				$this->response->error = $output;
				unset($this->response->body);
			}
		}

		return $this->response;
	}
30749
protected function getAuthHeader()
    {
        if ($this->apiClient->accessToken && $this->apiClient->accessToken->isValid) {
            return 'Authorization: OAuth ' . $this->apiClient->accessToken->token;
        }
        throw new InvalidParamException('NOT VALID ACCESS TOKEN', self::CODE_UNAUTHORIZED);
    }
1179325
public function redirect()
    {
        if (!$this->isStateless()) {
            $this->request->getSession()->put(
                'oauth.temp', $temp = $this->server->getTemporaryCredentials()
            );
        } else {
            $temp = $this->server->getTemporaryCredentials();
            $this->request->session()->put('oauth_temp', serialize($temp));
        }

        return new RedirectResponse($this->server->getAuthorizationUrl($temp));
    }
90913
public function getAuthorizationCode() {

		if (isset($_GET['error'])) {
			throw new OAuthException($_GET['error'], 1);	
		} elseif (!isset($_GET['code']) || !isset($_GET['state'])) {
			throw new OAuthException('Invalid parameters', 2);
		} elseif (!isset($_SESSION[$this->oauth_key]['state'])) {
			throw new OAuthException('No state found', 3);
		} elseif ($_GET['state'] != $_SESSION[$this->oauth_key]['state']) {
			throw new OAuthException('State invalid', 4);
		}

		return $_GET['code'];
	}
509480
public function getResponse()
    {
        if (is_null($this->response)) {
            $this->response = $this->getRunner()->run();
        }
        return $this->response;
    }
57378
public function getTokens(): array
    {
        $response = $this
            ->httpClient
            ->get(
                sprintf(
                    '/%s/tokens',
                    $this->getAppUUID()->getId()
                ),
                'get',
                [],
                [],
                Http::getApisearchHeaders($this)
            );

        self::throwTransportableExceptionIfNeeded($response);

        return array_map(function (array $token) {
            return Token::createFromArray($token);
        }, $response['body']);
    }
525109
public function getResponse()
    {
        $response = redirect()->to($this->getRedirectUrl());
        $response->withInput($this->request->input());
        $response->withErrors($this->getErrors(), 'default');
        $response->setCharset(config('app.charset', 'UTF-8'));

        return $response;
    }
878823
public function getResponse()
    {
        $this->addParameters()->addHeaders();
        $this->options[CURLOPT_RETURNTRANSFER] = true;

        $this->meta = call_user_func($this->map, $this->options);

        return $this->meta['response'];
    }
271996
public function send()
    {
        if (!$this->auth_code) {
            $this->getAuthCode();
        }

        return [
            'redirect'             => $this->redirect,
            'transactionReference' => $this->transactionReference,
            'auth_code'            => $this->auth_code,
        ];
    }
999324
public function callbackAction()
    {
        try {
            $response = $this->getPaymentHandler()->getPaymentCallbackResponse($this->getCurrentRequest());
        } catch (EntityNotFoundException $ex) {
            throw new NotFoundHttpException($ex->getMessage());
        } catch (InvalidTransactionException $ex) {
            throw new UnauthorizedHttpException($ex->getMessage());
        }

        return $response;
    }
415780
private function getAuthCode()
    {
        $amount = intval($this->parameters['amount']);
        if (!$this->sandbox) {
            $url = $this->endpoint . "/Auth/{$this->parameters['custom']}/{$this->parameters['transactionId']}/{$amount}";
            $url_redirect = $this->endpoint_redirect;
        } else {
            $url = $this->sandbox_endpoint . "/Auth/{$this->options['app_key']}/{$this->parameters['transactionId']}/{$amount}";
            $url_redirect = $this->sandbox_endpoint_redirect;
        }
        $response = $this->xml2array($this->curl_request($url));
        $output = explode('|', $response['0']);
        if ($output['0'] != 1) {
            throw new \Exception($output['1']);
        }

        $this->transactionReference = $output['2'];
        $this->auth_code = $output['3'];
        $this->redirect = $url_redirect . '?AuthCode=' . $this->auth_code;
    }
1195674
final public function getResponse()
    {
        if (empty($this->response)) {
            $httpMethod = $this->getRequest()
                ? strtoupper($this->getRequest()->getMethod())
                : 'GET'
            ;

            if ($this->isHttpMethodSupported($httpMethod)) {
                $functionName = $this->getFunctionName($httpMethod);
                Logger::get()->debug("Running responder method '$functionName'...");
                // If the responder is a restricted one...
                if ($this instanceof \Eix\Core\Responders\Restricted) {
                    // ... ensure the user is allowed to use that function.
                    Users::getCurrent()->checkAuthorisation($this, $functionName);
                }

                // The response is the result of executing the appropriate
                // responder function.
                $this->response = $this->$functionName();
            } else {
                throw new \Eix\Services\Net\Http\MethodNotAllowedException("This responder does not support {$httpMethod} requests.");
            }
        }

        return $this->response;
    }
1233088
public function getAccessToken()
    {
        try {
            $response = $this->post('/oauth/token')->send();
        } catch (ClientErrorResponseException $e) {
            throw OauthException::factory($e->getRequest(), $e->getResponse());
        }
        return new AccessToken($this, $response);
    }
227143
public function getTokenResponse()
    {
        $query = [
            'grant_type' => 'client_credential',
            'appid' => $this['appid'],
            'secret' => $this['appsecret'],
        ];

        $response = Http::request('GET', static::ACCESS_TOKEN)
            ->withQuery($query)
            ->send();

        if ($response->containsKey('errcode')) {
            throw new \Exception($response['errmsg'], $response['errcode']);
        }

        return $response;
    }