AuthSub ve Blogger

0 Cevap php

I'm trying to retrieve a list of blogs of a given user. I think I've successivelly authorizated myself with all the token stuff, but when I ask for the list blog, I recieve a 302 moved temporarily. I'm using curl to send the requests.

Benim arama sayfasında, ben bir oturum belirteci belirteci yükseltme:

$header = array();
$header[] = 'GET /accounts/AuthSubSessionToken HTTP/1.1';
$header[] = 'Authorization: AuthSub token="'.$_GET['token'].'"';

$curl = curl_init('https://www.google.com/accounts/AuthSubSessionToken');
curl_setopt( $curl, CURLOPT_HTTPHEADER, $header );
curl_setopt( $curl, CURLOPT_HEADER, true );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec( $curl );

Ben bu yanıtı edinin:

HTTP/1.1 200 OK
Content-Type: text/plain; charset=UTF-8
Date: Thu, 15 Jul 2010 20:08:07 GMT
Expires: Thu, 15 Jul 2010 20:08:07 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Content-Length: 39
Server: GSE

Tamam, şimdi ben bunu, ben veri alma için hazır olduğumu düşünüyorum:

$headers = array();
$headers[] = 'GET /feeds/default/blogs HTTP/1.1';
$headers[] = 'Authorization: AuthSub token="'.$token.'"';
$headers[] = 'Host: www.blogger.com';

$curl = curl_init( 'http://www.blogger.com' );
curl_setopt( $curl, CURLOPT_CONNECTTIMEOUT, 5 );
curl_setopt( $curl, CURLOPT_TIMEOUT, 5 );
curl_setopt( $curl, CURLOPT_PORT, 80 );
curl_setopt( $curl, CURLOPT_HEADER, true );
curl_setopt( $curl, CURLOPT_HTTPHEADER, $headers );
curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
curl_setopt( $curl, CURLOPT_FOLLOWLOCATION, true );
curl_setopt( $curl, CURLOPT_MAXREDIRS, 5);
$reply = curl_exec( $curl );

But I always receive a 302 moved temporarily. I've checked I have not enabled safe_mode nor openbasedir to allow CURLOPT_FOLLOWLOCATION work, and I also checked with

curl_getinfo( $curl, CURLINFO_EFFECTIVE_URL );

kıvırmak yönlendirmeyi çalışıyor emin olmak istedi son url buydu.

Belki biraz AuthSub adım yanlış yaptım?

PD: Açıkçası ben oturumu-token ayıklar kodunu ommited, ama ben çift kontrol ettim ve ben başlığının doğru parçayı kapmak.

0 Cevap