/** * Returns the response from the Oauth callback. * @throws InvalidArugmentException * @return array The response */ protected function getOpauthResponse() { $config = OpauthAuthenticator::get_opauth_config(); $transportMethod = $config['callback_transport']; switch ($transportMethod) { case 'session': return $this->getResponseFromSession(); break; case 'get': case 'post': return $this->getResponseFromRequest($transportMethod); break; default: throw new InvalidArgumentException('Invalid transport method: ' . $transportMethod); break; } }