2013-06-16 4 views
5

मैं जो ट्विटर के साथ प्रमाणित करता है एक बुनियादी एप्लिकेशन बनाने के लिए, और पुस्तकालय codebird-php के माध्यम से एक उपयोगकर्ता की ओर से संदेश पोस्ट कोशिश कर रहा हूँ (https://github.com/mynetx/codebird-php)कोडबर्ड-पीएचपी ट्विटर ऐप। त्रुटि 77 जबकि ट्विटर एपीआई प्रमाण पत्र मान्य

मैं उदाहरण copypasted है कोड रीडेमे पर दिखाया गया है, और मेरे ऐप की कुंजी और गुप्त के साथ यूर्की और यूट्रेसक्रेट बदल दिया।

सब कुछ ठीक काम करना चाहिए, लेकिन जब मैं अपना पेज लोड करता हूं, तो मुझे एक संदेश मिलता है: ट्विटर एपीआई प्रमाण पत्र को सत्यापित करते समय त्रुटि 77।

मुझे यह त्रुटि प्रकार कहीं भी Google पर नहीं मिल रहा है ... इसका अर्थ काफी स्पष्ट है लेकिन मुझे नहीं पता कि इसे कैसे हल किया जाए। कोई विचार?

require_once ('codebird.php'); 
\Codebird\Codebird::setConsumerKey('YOURKEY', 'YOURSECRET'); // I changed it to my settings 

$cb = \Codebird\Codebird::getInstance(); 
session_start(); 

if (! isset($_SESSION['oauth_token'])) { 
// get the request token 
$reply = $cb->oauth_requestToken(array(
    'oauth_callback' => 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] 
)); 

// store the token 
$cb->setToken($reply->oauth_token, $reply->oauth_token_secret); 
$_SESSION['oauth_token'] = $reply->oauth_token; 
$_SESSION['oauth_token_secret'] = $reply->oauth_token_secret; 
$_SESSION['oauth_verify'] = true; 

// redirect to auth website 
$auth_url = $cb->oauth_authorize(); 
header('Location: ' . $auth_url); 
die(); 

} elseif (isset($_GET['oauth_verifier']) && isset($_SESSION['oauth_verify'])) { 
// verify the token 
$cb->setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); 
unset($_SESSION['oauth_verify']); 

// get the access token 
$reply = $cb->oauth_accessToken(array(
    'oauth_verifier' => $_GET['oauth_verifier'] 
)); 

// store the token (which is different from the request token!) 
$_SESSION['oauth_token'] = $reply->oauth_token; 
$_SESSION['oauth_token_secret'] = $reply->oauth_token_secret; 

// send to same URL, without oauth GET parameters 
header('Location: ' . basename(__FILE__)); 
die(); 
} 

// assign access token on each page load 
$cb->setToken($_SESSION['oauth_token'], $_SESSION['oauth_token_secret']); 

उत्तर

5

हल, मैं .pem जो पैकेज मैंने डाउनलोड में शामिल नहीं किया गया है करने के लिए किया था:

कोड इस प्रकार है। निष्कर्ष: अविश्वसनीय स्रोतों से कभी डाउनलोड न करें!

+0

किसी कारण से मेरा एक .pem में बदल गया .cer –

0

यह देखने के लिए खुशी हुई कि इससे आपकी समस्या हल हो गई।

वैसे, आपने मूल रूप से कोडबर्ड कहाँ से डाउनलोड किया था?

+0

फ़ोरम पर कुछ ट्यूटोरियल, मैं आपके लिए यह ढूंढने की कोशिश करूंगा। – xShirase

+0

http://www.queness.com/post/14004/easiest-way-to-retrieve-twitter-timeline-and-hashtags-twitter-oauth-api-11? –

संबंधित मुद्दे