Hello Dave,

What scopes are you using when requesting your OAuth access token/code?
Also, why are you URL encoding the OAuth Token? You shouldn't have to do
that as if it is passed in the header.

Best,
Alain

On Tue, Jun 21, 2011 at 11:24 AM, Dave King <[email protected]> wrote:

> How are we supposed to make a Calendar API request using OAuth 2.0 access
> tokens?
>
> I've tried 3 different approaches, and each has failed:
>
> 1. Authorization header as specified in Calling a protected 
> API<http://code.google.com/apis/accounts/docs/OAuth2.html#CallingAnAPI>
>
> $ curl https://www.google.com/calendar/feeds/default/allcalendars/full -H
> 'Authorization: OAuth 1%2FsCO7...QixQ'
>
> <HTML>
> <HEAD>
> <TITLE>Token invalid - Invalid AuthSub token.</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Token invalid - Invalid AuthSub token.</H1>
> <H2>Error 401</H2>
> </BODY>
> </HTML>
>
> 2. URL parameter as specified in Calling a protected 
> API<http://code.google.com/apis/accounts/docs/OAuth2.html#CallingAnAPI>
>
> $ curl
> https://www.google.com/calendar/feeds/default/allcalendars/full?oath_token=1%2FsCO7...Q
> <HTML>
> <HEAD>
> <TITLE>Authorization required</TITLE>
> </HEAD>
> <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
> <H1>Authorization required</H1>
> <H2>Error 401</H2>
> </BODY>
> </HTML>
>
> 3. Extending the OAuth example in Authenticating to the Calendar 
> service<http://code.google.com/apis/calendar/data/2.0/developers_guide_protocol.html#Auth>
> https://www.google.com/calendar/feeds/default/allcalendars/full -H
> 'Authorization: OAuth oauth_version="2.0", oauth_token="1%2FsCO...M1m3QixQ"'
>
> Perhaps I'm not registering for the service correctly. On the OAuth 2.0 API
> Console <http://code.google.com/apis/console> page there isn't an option
> for the Calendar API or the Data API. I was able to generate an access token
> using the scope: '
> http://www.google.com/calendar/feeds/default/allcalendars/full'
>
> Please help.
>
> Thanks.
>
> Dave King
>
> --
> 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://code.google.com/apis/calendar/community/forum.html
>



-- 
Alain Vongsouvanh | Developer Programs Engineer | [email protected] | +1 650
479-6719

-- 
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://code.google.com/apis/calendar/community/forum.html

Reply via email to