2009/10/8 Ma Begaj <[email protected]>:
>> Hi,
>>
>> I am trying to use Calendar API with OAuth but it does not work. I
>> always receive this html:
>> <HTML>
>> <HEAD>
>> <TITLE>Unknown authorization header</TITLE>
>> </HEAD>
>> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
>> <H1>Unknown authorization header</H1>
>> <H2>Error 401</H2>
>> </BODY>
>> </HTML>
>>
>> and these headers:
>>            [expires] => Fri, 02 Oct 2009 11:43:00 GMT
>>            [date] => Fri, 02 Oct 2009 11:43:00 GMT
>>            [www-authenticate] => GoogleLogin realm="https://
>> www.google.com/accounts/ClientLogin", service="cl"
>>            [content-type] => text/html; charset=UTF-8
>>            [content-length] => 179
>>            [cache-control] => private, max-age=0
>>            [x-content-type-options] => nosniff
>>            [x-frame-options] => SAMEORIGIN
>>            [server] => GFE/2.0
>>            [x-xss-protection] => 0
>>
>>
>> This is what I send on the request.
>> GET /calendar/feeds/default/allcalendars/full HTTP/1.0
>> Authorization: OAuth
>> realm="",oauth_consumer_key="www.mydomain.com",oauth_nonce="60f15a3471665f7f58f15ce0a3c4eb86",oauth_signature="cVDzk7CpvFcmAFAS
>> %2B8hjAvGfEak%3D",oauth_signature_method="HMAC-
>> SHA1",oauth_timestamp="1254483885",oauth_token="1%2FaScjB6lverZGuzgBiugiu",oauth_version="1.0"
>> Content-Type: application/atom+xml
>> Host: www.google.com
>> Content-Length: 0
>>
>> I always receive the same error message.
>>
>> When I just change URL to "http://www.google.com/calendar/feeds/
>> default/allcalendars/full", everything is working prefectly OK. That
>> means that my Authorization header is absolutely OK.
>>
>>
>> I did not test it with other APIs, only contacts and calendar.
>>
>> Someone with an idea? Did I miss something?
>>

Well I solved it and I did miss something.


Calendar is redirecting requests because of missing gsession. I was
following the redirect, but I forgot to resign the OAuth request
again.


So do not let your application just follow the link:
- get the link from the returned header
- resign it
- send new request

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to