private function checkConnection() { if (!isset($this->isvalid)) { Neuron_Auth_OAuthStore::getStore(); if (OAuthRequestVerifier::requestIsSigned()) { try { $this->request = new OAuthRequestVerifier(); $req = $this->request; $user_id = $req->verify(); // If we have an user_id, then login as that user (for this request) if ($user_id) { $this->userid = $user_id; $this->isvalid = true; return true; } } catch (OAuthException $e) { // The request was signed, but failed verification header('HTTP/1.1 401 Unauthorized'); header('WWW-Authenticate: OAuth realm=""'); header('Content-Type: text/plain; charset=utf8'); echo $e->getMessage(); exit; } } } return false; }
private function requesttoken() { Neuron_Auth_OAuthStore::getStore(); $server = new OAuthServer(); $token = $server->requestToken(); }