简体   繁体   English

Gdata 签名请求错误:“未知授权标头”

[英]Gdata signed request error: “Unknown authorization header”

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.但是在更新和删除时,我收到“未知授权标头”401 错误。

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.我尝试将 $eventUri 修改为 https 和 http,但似乎没有任何效果。

I've been getting this 401 error message too, creating the client and service the same way.我也收到了这个 401 错误消息,以相同的方式创建客户端和服务。 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 .它可能尚未得到官方支持。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM