Gdata signed request error: “Unknown authorization header”

ぃ、小莉子 提交于 2019-12-25 03:39:10

问题


I have a problem with Updating and Deleting events using signed requests. Inserting events works just fine. But when Updating and Deleting I receive an "Unknown authorization header" 401 error.

For ALL three operations I first generate the client like this:

$client = new Zend_Gdata_HttpClient();  
$client->setAuthSubPrivateKeyFile('certificates/gcalkey.pem', null, true);
$client->setAuthSubToken($session_token);
$gdataCal = new Zend_Gdata_Calendar($client);

To Update an event I use this:

$eventOld = $gdataCal->getCalendarEventEntry($eventUri);

$eventOld->title = $gdataCal->newTitle('NEW NAME');
try {
    $eventOld->save();
} catch (Zend_Gdata_App_Exception $e) { print_r($e); exit; }

And it gives me the "Unknown authorization header" error. But the same code, using unsigned requests, works.

Where might be the problem? I tried modifying $eventUri to both https and http, but it seems it does not have any effect.


回答1:


I've been getting this 401 error message too, creating the client and service the same way. It can retrieve a list of calendars, but fails when retrieving an event feed.

Has this worked for you before? It might not be officially supported yet.



来源:https://stackoverflow.com/questions/6691959/gdata-signed-request-error-unknown-authorization-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!