I’m writing a Twitter based application for iPhone, based on a web service written by me. I need to verify the user credentials, before inserting a new image on my database.
I think that the correct flow is using OAuth Echo, in order to verify user credentials, before updating my database.
However i’m stuck with this operation in two points:
- forwarding the X-Verify-Credentials-Authorization from the user request into a fresh forged curl request, like the following:
$header = array( 'X-Verify-Credentials-Authorization: ' . $allHeaders['X-Verify-Credentials-Authorization'] ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.twitter.com/1/account/verify_credentials.json"); curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $respond = curl_exec($ch); $response_info = curl_getinfo($ch);
always give me a 401 error.