Google Groups Home
Help | Sign in
OAuth support for Google Accounts and Contacts API
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 29 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Wei  
View profile  
(8 users)  More options Apr 25 2008, 5:29 pm
From: Wei <weitu+oa...@google.com>
Date: Fri, 25 Apr 2008 14:29:11 -0700 (PDT)
Local: Fri, Apr 25 2008 5:29 pm
Subject: OAuth support for Google Accounts and Contacts API
Hi folks,

We are happy to announce that the Google Contacts Data API now
supports OAuth. This is our first step towards OAuth enabling all
Google Data APIs. Please note that this is an alpha release and we may
make changes to the protocol before the official release.  I will be
at the OAuth hackathon tomorrow to get feedback and help consumers
integrate.

Here are the three end points used in OAuth to get a token:
https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www...
https://www.google.com/accounts/OAuthAuthorizeToken
https://www.google.com/accounts/OAuthGetAccessToken

To register for a consumer key / upload your RSA public key:
https://www.google.com/accounts/ManageDomains
(see http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto....
for help on registering your domain)

Caveats:
- We currently only support RSA-SHA1 mode.
- The consumer key is the domain hostname you registered.  Currently
there are no consumer_secrets.
- The scope parameter specifies the URL identifying the service to be
accessed. See http://code.google.com/apis/contacts/developers_guide_protocol.html
for details about the Google Contacts Data API.

You can download a sample client at http://weitu.googlepages.com/GoogleDataOAuthSample.jar.
Alternatively, Andy Smith (termie) has written a php test server
(http://term.ie/oauth/example/client.php?sig_method=RSA-SHA1) that
provides an easy way to test getting OAuth tokens with RSA.  It uses
the example key pair on the OAuth wiki (http://wiki.oauth.net/
TestCases).  We have set up a test consumer with
consumer_key=weitu.googlepages.com that uses the same RSA key pair for
you to test with.

Let me know if you run into any problems,

Wei


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Messina  
View profile  
(2 users)  More options Apr 25 2008, 5:35 pm
From: "Chris Messina" <chris.mess...@gmail.com>
Date: Fri, 25 Apr 2008 14:35:57 -0700
Local: Fri, Apr 25 2008 5:35 pm
Subject: Re: [oauth] OAuth support for Google Accounts and Contacts API

YAY!!!!!!!!
I'll definitely sponsor a round of drinks at tomorrow's OAuth Hackathon! ;)

Chris

On Fri, Apr 25, 2008 at 2:29 PM, Wei
<weitu+oa...@google.com<weitu%2Boa...@google.com>>
wrote:

--
Chris Messina
Citizen-Participant &
Open Source Advocate-at-Large
Work: http://citizenagency.com
Blog: http://factoryjoe.com/blog
Cell: 412.225.1051
IM: factoryjoe
This email is: [ ] bloggable [X] ask first [ ] private

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Eran Hammer-Lahav  
View profile  
 More options Apr 25 2008, 5:34 pm
From: Eran Hammer-Lahav <e...@hueniverse.com>
Date: Fri, 25 Apr 2008 17:34:21 -0400
Local: Fri, Apr 25 2008 5:34 pm
Subject: RE: [oauth] Re: OAuth support for Google Accounts and Contacts API

In the spirit of Passover, please fill a cup with my name on it and leave it untouched on the table...

A few more weeks and all this East Coast nonsense will be over...

EHL

From: oauth@googlegroups.com [mailto:oauth@googlegroups.com] On Behalf Of Chris Messina
Sent: Friday, April 25, 2008 5:36 PM
To: oauth@googlegroups.com
Subject: [oauth] Re: OAuth support for Google Accounts and Contacts API

YAY!!!!!!!!

I'll definitely sponsor a round of drinks at tomorrow's OAuth Hackathon! ;)

Chris

On Fri, Apr 25, 2008 at 2:29 PM, Wei <weitu+oa...@google.com<mailto:weitu%2Boa...@google.com>> wrote:

Hi folks,

We are happy to announce that the Google Contacts Data API now
supports OAuth. This is our first step towards OAuth enabling all
Google Data APIs. Please note that this is an alpha release and we may
make changes to the protocol before the official release.  I will be
at the OAuth hackathon tomorrow to get feedback and help consumers
integrate.

Here are the three end points used in OAuth to get a token:
https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www...
https://www.google.com/accounts/OAuthAuthorizeToken
https://www.google.com/accounts/OAuthGetAccessToken

To register for a consumer key / upload your RSA public key:
https://www.google.com/accounts/ManageDomains
(see http://code.google.com/apis/accounts/docs/RegistrationForWebAppsAuto....
for help on registering your domain)

Caveats:
- We currently only support RSA-SHA1 mode.
- The consumer key is the domain hostname you registered.  Currently
there are no consumer_secrets.
- The scope parameter specifies the URL identifying the service to be
accessed. See http://code.google.com/apis/contacts/developers_guide_protocol.html
for details about the Google Contacts Data API.

You can download a sample client at http://weitu.googlepages.com/GoogleDataOAuthSample.jar.
Alternatively, Andy Smith (termie) has written a php test server
(http://term.ie/oauth/example/client.php?sig_method=RSA-SHA1) that
provides an easy way to test getting OAuth tokens with RSA.  It uses
the example key pair on the OAuth wiki (http://wiki.oauth.net/
TestCases).  We have set up a test consumer with
consumer_key=weitu.googlepages.com<http://weitu.googlepages.com> that uses the same RSA key pair for
you to test with.

Let me know if you run into any problems,

Wei

--
Chris Messina
Citizen-Participant &
Open Source Advocate-at-Large
Work: http://citizenagency.com
Blog: http://factoryjoe.com/blog
Cell: 412.225.1051
IM: factoryjoe
This email is: [ ] bloggable [X] ask first [ ] private


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex  
View profile  
 More options May 16 2008, 7:26 pm
From: alex <bitterco...@gmail.com>
Date: Fri, 16 May 2008 16:26:05 -0700 (PDT)
Local: Fri, May 16 2008 7:26 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
Hi Wei,

I've been attempting to get this work with an OAuth consumer &
provider I'm working on in C# - but it appears I'm generating an
invalid signature when requesting a token... as the response from the
server suggests:

signature_invalid       base_string:GET&https%3A%2F%2Fwww.google.com
%2Faccounts%2FOAuthGetRequestToken&oauth_consumer_key
%3Dweitu.googlepages.com%26oauth_nonce
%3D5369726%26oauth_signature_method%3DRSA-SHA1%26oauth_timestamp
%3D1210979395%26oauth_version%3D1.0%26scope%3Dhttp%25253a%25252f
%25252fwww.google.com%25252fm8%25252ffeeds

The request uri I'm generating is:

https://www.google.com/accounts/OAuthGetRequestToken?scope=http%253a%...

I've compared the base_string returned from google to the one I'm
generating and they're identical... so it looks to be a problem with
the way I'm generating the signature.

I've also tested the same request token implementation against termies
test server at http://term.ie/oauth/example/client.php?sig_method=RSA-SHA1
and it works just fine, using the same private key.... so I'm at a bit
of a loss... any chance the certificates changed lately?

Cheers,

 - Alex


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Sergent  
View profile  
(1 user)  More options May 16 2008, 7:56 pm
From: "Jonathan Sergent" <serg...@google.com>
Date: Fri, 16 May 2008 16:56:32 -0700
Local: Fri, May 16 2008 7:56 pm
Subject: Re: [oauth] Re: OAuth support for Google Accounts and Contacts API
We looked and did not see any obvious problems other than that you are
escaping the scope URL twice before sending it.  However, the base
string also shows it escaped twice, so this shouldn't cause a
signature failure.  However, you may want to try fixing that.  One
gotcha I have seen with URL escaping from C# clients before is that it
uses lowercase letters by default, and the OAuth spec says to always
use uppercase letters when generating the base string.  Are you sure
that your base string really does match bit for bit with the one we
returned?


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alex  
View profile  
 More options May 18 2008, 7:41 am
From: alex <bitterco...@gmail.com>
Date: Sun, 18 May 2008 04:41:38 -0700 (PDT)
Local: Sun, May 18 2008 7:41 am
Subject: Re: OAuth support for Google Accounts and Contacts API
Thanks for the tips.

I have my consumer implementation working now :) it appears my
signature issues were caused my lack of url-encoding query parameters
prior to including them in the base string, something that wasn't
entirely clear from the first time I read the core spec.

i.e. for the url:

https://www.google.com/accounts/OAuthGetRequestToken?scope=http://www...

I needed to url encode the "http://www.google.com/m8/feeds" scope
value, prior to the concatenation of parameters and consequent url
encoding in the signature base string (so that it would be encoded
properly).

Cheers,

 - Alex

On May 17, 11:56 am, "Jonathan Sergent" <serg...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
blweiner  
View profile  
 More options May 21 2008, 3:35 am
From: blweiner <blwei...@gmail.com>
Date: Wed, 21 May 2008 00:35:56 -0700 (PDT)
Local: Wed, May 21 2008 3:35 am
Subject: Re: OAuth support for Google Accounts and Contacts API
Thanks so much for supporting OAuth.

I had no problem getting a request token and an access token, but when
I went to request http://www.google.com/m8/feeds/contacts/default/base
with the access token, I received a 401 response.

Here is my Authorization header for the request:

OAuth realm="",
      oauth_token="CIun47rvChDeuonpBQ",
      oauth_consumer_key="lostinpatterns.com",
      oauth_signature_method="RSA-SHA1",
      oauth_timestamp="1211326240",
      oauth_nonce="ggAQLfsVxmeZXDCooBJNVlV1GFavfrIDHioNlZqZyY",
      oauth_signature="N6Cn2zewQFRN9bErb1d72cl%2BqETQxoT
%2B1NsqQv1zBZvTqd%2Fb6wRJIJm%2FJBze
%0AdxnpSpbGqPVNgC3W50WQwCTnaCMedmQR37c8EJ5GycDZ8yJFLJtyYh%2F%2FE%2FVq
%0Aq7LA6BeDaC6aUGh%2BtEpP%2BZuWJTT0yGWLfbIKYlEE0jnRpDRyXGs%3D",
      oauth_version="1.0"

Is there any reason why I'd have no problem getting the tokens, but
would have a problem accessing the protected resources? Is it possible
the certificate is verified only when I try to access the resources?

On Apr 25, 4:29 pm, Wei <weitu+oa...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
smn  
View profile  
 More options May 26 2008, 11:27 am
From: smn <si...@soocial.com>
Date: Mon, 26 May 2008 08:27:24 -0700 (PDT)
Local: Mon, May 26 2008 11:27 am
Subject: Re: OAuth support for Google Accounts and Contacts API
Hi,

I'm running into some issues with the optional callback URL for
OAuthentication between web applications.
How and where can I set the callback url?

I'm looking for the `next=` type of parameter that AuthSub would
allow.

cheers, Simon

On Apr 25, 11:29 pm, Wei <weitu+oa...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wei  
View profile  
 More options May 26 2008, 7:49 pm
From: Wei <weitu+oa...@google.com>
Date: Mon, 26 May 2008 16:49:50 -0700 (PDT)
Local: Mon, May 26 2008 7:49 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
It is the oauth_callback parameter during the authorization step.

On May 26, 8:27 am, smn <si...@soocial.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wei  
View profile  
 More options May 26 2008, 7:50 pm
From: Wei <weitu+oa...@google.com>
Date: Mon, 26 May 2008 16:50:15 -0700 (PDT)
Local: Mon, May 26 2008 7:50 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
Ben and I resolved this offline.

On May 21, 12:35 am, blweiner <blwei...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
ckstjohn@gmail.com  
View profile  
 More options Jun 2 2008, 2:26 pm
From: "ckstj...@gmail.com" <ckstj...@gmail.com>
Date: Mon, 2 Jun 2008 11:26:20 -0700 (PDT)
Local: Mon, Jun 2 2008 2:26 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
On May 26, 6:50 pm, Wei <weitu+oa...@google.com> wrote:

> Ben and I resolved this offline.

> On May 21, 12:35 am, blweiner <blwei...@gmail.com> wrote:

> > I had no problem getting a request token and an access token, but when
> > I went to requesthttp://www.google.com/m8/feeds/contacts/default/base
> > with the access token, I received a 401 response.

> > Is there any reason why I'd have no problem getting the tokens, but
> > would have a problem accessing the protected resources?

I was experimenting with the Ruby OAuth implementation, and
(after some twiddling with the source) managed to get data
out of the contacts API.

I ended up:

 - Switching the scope url to https rather than plain http
 (otherwise I got a 401 saying there was an unknown
 authorization header)

 - Switch the data URL (m8/feeds/contacts/cstjohn%40gmail.com/full)
 to use https rather then http (otherwise I got an authsub
 has wrong scope error, which seemed fair enough given that I'd
 asked for https in the scope)

 - Encode the scope URL (as mentioned above)

Some of those may have been issues with the Ruby OAuth
library (or my hacking of it), but I thought I'd offer it
for the benefit of anyone else trying something similar.

-cks

--
Christopher St. John
ckstj...@gmail.com
http://artofsystems.blogspot.com


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wei  
View profile  
 More options Jun 2 2008, 2:41 pm
From: Wei <weitu+oa...@google.com>
Date: Mon, 2 Jun 2008 11:41:55 -0700 (PDT)
Local: Mon, Jun 2 2008 2:41 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
Can you let me know offline how exactly http requests failed for you?
We accept both http and https.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Henderson  
View profile  
 More options Jun 18 2008, 8:24 pm
From: "Alex Henderson" <bitterco...@gmail.com>
Date: Thu, 19 Jun 2008 12:24:27 +1200
Local: Wed, Jun 18 2008 8:24 pm
Subject: RE: [oauth] Re: OAuth support for Google Accounts and Contacts API
I'm having a similar problem with 401 responses with code that was working a
week ago ... I can request a token, exchange it for an access token etc. but
when making requests using the access token I now receive a 401 response..
I've tried some of the tips below i.e. switching the schemes to https
instead of http for the scope etc.  But it doesn't seem to make a
difference, what's wrong with the request I'm making to the protected
resource?

Here are the requests:

GET
/accounts/OAuthGetRequestToken?scope=https%3A%2F%2Fwww.google.com%2Fm8%2Ffee
ds&oauth_nonce=8a3542c9-e43c-4cdf-ab82-f9e9424fda77&oauth_consumer_key=weit u
.googlepages.com&oauth_signature_method=RSA-SHA1&oauth_timestamp=1213834722 &
oauth_version=1.0&oauth_token=&oauth_signature=f8lmelPabpvb24GXrsEw9jOZsRsl 7
VQUY4Mv%2B%2FPF1oMYg0Y%2BxzcvpCeyjFayfZXM4FYulKoSmswdcHNjJh8eUIKhSsCLpvlo8% 2
FAq%2F%2FODdTw9tG%2FYALKeN%2FK6ELMH91i9ZvlMpknD4VimO5dKDe4rNQUWwbnljftFuR1m %
2BhYIA8Y%3D HTTP/1.1

-> oauth_token=CMiJx-LdFxDk9-6r-_____8B&oauth_token_secret=

GET
/accounts/accounts/OAuthAuthorizeToken?scope=https://www.google.com/m8/feeds
&oauth_token=CMiJx-LdFxDk9-6r-_____8B HTTP/1.1

* grant access *

GET
/accounts/OAuthGetAccessToken?scope=https%3A%2F%2Fwww.google.com%2Fm8%2Ffeed
s&oauth_token=CMiJx-LdFxDk9-6r-_____8B&oauth_nonce=49d793bd-9f3c-4b13-89db- 6
a693ab3d5aa&oauth_consumer_key=weitu.googlepages.com&oauth_signature_method =
RSA-SHA1&oauth_timestamp=1213834735&oauth_version=1.0&oauth_signature=lldAl a
asOsFeddN4%2BpWb3JUr%2B48v0pZTj0nrjyQw1%2FMeUm5mzVzFwM%2BnUfqpmv%2F8h8uMDkG O
%2FSSuoGY%2BzolH1evslZZXDin26ZoSkWxYCtgyPvHesPoFSj%2FNbqGEQkMI4AwrWdnVxGW32 L
aoSQgfcieD9Psj7TTzIftpes6Jkyc%3D HTTP/1.1

->
oauth_token=1%2FAcsGwK8z4zYQzrm7XX6-KmATiaQZnWPB51nTvo8n9Sw&oauth_token_sec r
et=

GET
/m8/feeds/contacts/default/base?scope=https%3A%2F%2Fwww.google.com%2Fm8%2Ffe
eds&oauth_token=1%2FAcsGwK8z4zYQzrm7XX6-KmATiaQZnWPB51nTvo8n9Sw&oauth_nonce =
40e7f1bf-bb4c-49b1-8f1d-d27693fa6bd7&oauth_consumer_key=weitu.googlepages.c o
m&oauth_signature_method=RSA-SHA1&oauth_timestamp=1213834736&oauth_version= 1
.0&oauth_signature=ihwMkduk9CFqqm9rxfn1aXx4eK9HiLhz1U9ULRN%2Butpd2MnUgD%2BU w
2WVaph2tEai7LM8rtlxOgaJmNBegDhgFwOR%2Fvpxfrk4JpLTg1kno21Y4Igo2AIHmgU4MvD39Y 9
zd4WB4uoaxPLVlQWCr3WIS2wv9GjqLPhnS%2BzKttD1fqg%3D HTTP/1.1

The last request get's a response of:

<HTML>
<HEAD>
<TITLE>Authorization required</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Authorization required</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

I'm sure it's something simple - I just can't spot it.

Cheers,

 - Alex


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wei  
View profile  
 More options Jun 18 2008, 8:54 pm
From: Wei <weitu+oa...@google.com>
Date: Wed, 18 Jun 2008 17:54:57 -0700 (PDT)
Local: Wed, Jun 18 2008 8:54 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
I will help Alex debug offline.

On Jun 18, 5:24 pm, "Alex Henderson" <bitterco...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wei  
View profile  
 More options Jun 26 2008, 8:26 pm
From: Wei <weitu+oa...@google.com>
Date: Thu, 26 Jun 2008 17:26:17 -0700 (PDT)
Local: Thurs, Jun 26 2008 8:26 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
Just want to let you know that we officially support OAuth for all
Google Data APIs.

http://googledataapis.blogspot.com/2008/06/oauth-for-google-data-apis...

OAuth for Google Data APIs
Thursday, June 26, 2008 at 4:36 PM

Posted by Wei Tu, Google Accounts Team

The Google Data APIs have always been built on open standards, and
today we're proud to announce that all of the Google Data APIs support
OAuth - an open standard for authentication.

You'll now be able to use standard OAuth libraries to write code that
authenticates users to any of the Google Data APIs, such as Google
Calendar Data API, Blogger Data API, Picasa Web Albums Data API, or
Google Contacts Data API. This should reduce the amount of duplicate
code that you need to write, and make it easier for you to write
applications and tools that work with a variety of services from
multiple providers.

See the documentation for the full details on how to use OAuth with
the Google Data APIs.

* OAuth also currently works for YouTube accounts that are linked to a
Google Account when using the YouTube Data API.

Wei

On Jun 18, 5:54 pm, Wei <weitu+oa...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Google OAuth support: hd authz parameter" by Manger, James H
Manger, James H  
View profile  
 More options Jun 26 2008, 9:18 pm
From: "Manger, James H" <James.H.Man...@team.telstra.com>
Date: Fri, 27 Jun 2008 11:18:05 +1000
Local: Thurs, Jun 26 2008 9:18 pm
Subject: Google OAuth support: hd authz parameter
Hi Wei,

Google's OAuth implementation is not as friendly to "standard OAuth libraries" as it could be. It defines a proprietary 'hd' (hosted domain) query parameter in the authorization URL. I think it would be better if the 'hd' parameter was included when getting a request token instead.

Accepting 'hd' in the authorization URL means this URL cannot be a pre-configured static input to an OAuth library. I assume it cannot be listed in an OAuth XRDS discovery document either (at a minimum it would have to be specified as a URI template, not a URL).

OAuth Core 1.0 §4.2 "Service Providers" implies an SP may require additional request parameters -- but only "to obtain a Token". I read this to allow proprietary parameters in requests for an unauthorized request token, but not in an authorization URL. It is reasonable to require them in the request token URL as this is the starting point -- it should identify what access is wanted (eg read access to a calendar for a mycollege.edu user), which will always be service-specific.

From that point on, however, an OAuth library should be able to drive the protocol without SP-specific knowledge.

If Google moved the 'hd' parameter from the Authorization URL to the Request Token URL it could encode the 'hd' value into the request token so it is still passed to the Google Authorization endpoint -- it just doesn't require Google-specific logic within OAuth libraries to do so.

TYPO: http://code.google.com/apis/accounts/docs/OAuth.html#GetAuth
The OAuthAuthorizeToken sample request has a 2nd '?' that should be a '&'.
WRONG: https://www…/OAuthAuthorizeToken?oauth_token=ab3…7g?hd=mycollege.edu
RIGHT: https://www…/OAuthAuthorizeToken?oauth_token=ab3…7g&hd=mycollege.edu

James Manger

----------
From: oauth@googlegroups.com [mailto:oauth@googlegroups.com] On Behalf Of Wei
Sent: Friday, 27 June 2008 10:26 AM
To: OAuth
Subject: [oauth] Re: OAuth support for Google Accounts and Contacts API

Just want to let you know that we officially support OAuth for all
Google Data APIs.

http://googledataapis.blogspot.com/2008/06/oauth-for-google-data-apis...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "OAuth support for Google Accounts and Contacts API" by Paddy
Paddy  
View profile  
 More options Jun 27 2008, 7:52 am
From: Paddy <padraic.br...@yahoo.com>
Date: Fri, 27 Jun 2008 04:52:07 -0700 (PDT)
Local: Fri, Jun 27 2008 7:52 am
Subject: Re: OAuth support for Google Accounts and Contacts API
Very cool. I gave it a go but the responses to the Request URL come
back with integers preceding and after the actual oauth_token and
oauth_token_secret string. I have no idea if these are something on
Google's side or mine - only happens on Google requests though.

Once I can strip those however, it appears to be rolling full
ahead ;).

Paddy

On Jun 27, 1:26 am, Wei <weitu+oa...@google.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paddy  
View profile  
 More options Jun 27 2008, 2:21 pm
From: Paddy <padraic.br...@yahoo.com>
Date: Fri, 27 Jun 2008 11:21:11 -0700 (PDT)
Local: Fri, Jun 27 2008 2:21 pm
Subject: Re: OAuth support for Google Accounts and Contacts API
Please disregard the integer issue - my client was simply handling
chunking later than expected.
Silly me!

Paddy

On Jun 27, 12:52 pm, Paddy <padraic.br...@yahoo.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Google OAuth support: hd authz parameter" by Wei
Wei  
View profile  
 More options Jun 27 2008, 3:05 pm
From: Wei <weitu+oa...@google.com>
Date: Fri, 27 Jun 2008 12:05:14 -0700 (PDT)
Local: Fri, Jun 27 2008 3:05 pm
Subject: Re: Google OAuth support: hd authz parameter
Hi James,

Thanks for your feedback!

FWIW, section 6.2.1 in the spec does allow any additional parameters
defined by the Service Provider for the authorization step.

That said, we definitely want to be as friendly to the oauth library
world as possible as it is our loss if we don't.  To clarify, the "hd"
parameter is completely optional as it is just a parameter to optimize
the UI flow for certain third party developers that only cares about a
fragment of Google users (i.e. targeted to a specific domain that uses
Google Apps).  I would say that this parameter resembles the language
pref parameter, which just makes more sense to be passed in during the
Authorization step than the request token step.

Also, I am curious why it is harder to implement libraries to have
dynamic Authorization URL than Request Token URL.  From my reading, it
sounds like you accepted the fact that we would need dynamic request
token url so you'd like to keep all the dynamic parameters in that
step so that you can have a static one for the authorization step.  Am
I understanding it correctly?

Thanks again!

Wei

On Jun 26, 6:18 pm, "Manger, James H"


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manger, James H  
View profile  
 More options Jun 29 2008, 11:08 pm
From: "Manger, James H" <James.H.Man...@team.telstra.com>
Date: Mon, 30 Jun 2008 13:08:49 +1000
Local: Sun, Jun 29 2008 11:08 pm
Subject: RE: Google OAuth support: hd authz parameter

Hi Wei,

> why it is harder to implement libraries to have dynamic Authorization URL than Request Token URL

It is no harder with OAuth Core 1.0 with no extensions.  It is harder once we start the eliminating the pre-configuration required for OAuth to work.
I want the Authorization URI and Access URI to be provided in the “WWW-Authentication: OAuth” header [other discovery options can give a vaguely similar result]. An OAuth library can then use these without needing to be specifically pre-configured to use this SP – as long as they don’t involve SP-specific parameters such as Google’s ‘hd’.
When the Authorization URI is provided dynamically in an SP response, the SP can insert the request token into this URI.
You still need a URI to start the process like the “Request Token URI”, but that name is not quite appropriate.

So a dynamic Authorization URI is not harder than a dynamic Request Token URI,
but it is harder than a dynamic “initial URI”.
I believe the Request Token URI will morph into an “initial URI” as we make progress eliminating the manual SP-specific configuration steps in OAuth.

Perhaps an easier way to explain it is with a concrete example that I think OAuth should support:

An app is developed that adds pretty frames to photos. It understands Atom feeds for representing collections of photos, as well as industry conventions for marking up thumbnails, captions and links to JPEGs. It understands OAuth. It has no SP-specific code. Optionally, it can be configured with credentials (a consumer key & secret, or consumer key & private RSA key).

Alice pastes the URI of her Google Picasa Web Photo Album in to the app. It works.
  http://picasaweb.google.com/data/feed/api/user/alice/album/beach_holiday

Within the app:
It is given a URI by a user;
The app GETs the URI;
The 401 response includes WWW-Auth.: OAuth authz=http… access=http…;
The app redirects the user to the authz URI it just got;
The app detects when it has been authorized;
The app gets an access token using the access URI;
The app reties the original URI the user gave it, this time with an OAuth signature;
The response has the photos for the app to process.

Picasa already provides URLs for photos grouped by user, album, query or contacts.
Picasa already uses standard Atom feeds and what I assume is industry-standard markup for photos.
The main barrier to this generic app (that has no SP-specific code) is the OAuth pre-configuration requirements. It would be a shame if we eliminated those, but Google-specific *code* is still required to make use of the useful ‘hd’ feature.

The app might add buttons for popular photo hosts – much like OpenID Relying Parties add buttons for popular OpenID Providers. The OpenID buttons are cosmetic changes. They are a trivial shortcut to manually entering, say, “yahoo.com”. The OpenID library is unaffected. The photo frame app could add a [mycollege.edu] button as a trivial cosmetic change if the ‘hd’ parameter was part of the “initial URI”, but not if it needs to be added to the Authorization URI.

I hope this makes some sense.

James Manger

_____________________________________________
From: oauth@googlegroups.com [mailto:oauth@googlegroups.com] On Behalf Of Wei
Sent: Saturday, 28 June 2008 5:05 AM
To: OAuth

Hi James,

Thanks for your feedback!

FWIW, section 6.2.1 in the spec does allow any additional parameters defined by the Service Provider for the authorization step.

That said, we definitely want to be as friendly to the oauth library world as possible as it is our loss if we don't.  To clarify, the "hd"
parameter is completely optional as it is just a parameter to optimize the UI flow for certain third party developers that only cares about a fragment of Google users (i.e. targeted to a specific domain that uses Google Apps).  I would say that this parameter resembles the language pref parameter, which just makes more sense to be passed in during the Authorization step than the request token step.

Also, I am curious why it is harder to implement libraries to have dynamic Authorization URL than Request Token URL.  From my reading, it sounds like you accepted the fact that we would need dynamic request token url so you'd like to keep all the dynamic parameters in that step so that you can have a static one for the authorization step.  Am I understanding it correctly?

Thanks again!

Wei

_____________________________________________
From: oauth@googlegroups.com<mailto:oauth@googlegroups.com> [mailto:oauth@googlegroups.com]<mailto:[mailto:oauth@googlegroups.com]> On Behalf Of Manger, James H
Sent: Friday, 27 June 2008 11:18 AM

Subject<mailto:oa...@googlegroups.comSubject>: [oauth] Google OAuth support: hd authz parameter

Hi Wei,

Google's OAuth implementation is not as friendly to "standard OAuth libraries" as it could be. It defines a proprietary 'hd' (hosted domain) query parameter in the authorization URL. I think it would be better if the 'hd' parameter was included when getting a request token instead.

Accepting 'hd' in the authorization URL means this URL cannot be a pre-configured static input to an OAuth library. I assume it cannot be listed in an OAuth XRDS discovery document either (at a minimum it would have to be specified as a URI template, not a URL).

OAuth Core 1.0 §4.2 "Service Providers" implies an SP may require additional request parameters -- but only "to obtain a Token". I read this to allow proprietary parameters in requests for an unauthorized request token, but not in an authorization URL. It is reasonable to require them in the request token URL as this is the starting point -- it should identify what access is wanted (eg read access to a calendar for a mycollege.edu user), which will always be service-specific.

From that point on, however, an OAuth library should be able to drive the protocol without SP-specific knowledge.

If Google moved the 'hd' parameter from the Authorization URL to the Request Token URL it could encode the 'hd' value into the request token so it is still passed to the Google Authorization endpoint -- it just doesn't require Google-specific logic within OAuth libraries to do so.

TYPO: http://code.google.com/apis/accounts/docs/OAuth.html#GetAuth
The OAuthAuthorizeToken sample request has a 2nd '?' that should be a '&'.
WRONG: https://www…/OAuthAuthorizeToken?oauth_token=ab3…7g?hd=mycollege.edu
RIGHT: https://www…/OAuthAuthorizeToken?oauth_token=ab3…7g&hd=mycollege.edu

James Manger


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Eaton  
View profile  
 More options Jun 30 2008, 12:47 pm
From: "Brian Eaton" <bea...@google.com>
Date: Mon, 30 Jun 2008 09:47:13 -0700
Local: Mon, Jun 30 2008 12:47 pm
Subject: Re: [oauth] RE: Google OAuth support: hd authz parameter
On Sun, Jun 29, 2008 at 8:08 PM, Manger, James H

<James.H.Man...@team.telstra.com> wrote:
> It is no harder with OAuth Core 1.0 with no extensions.  It is harder once
> we start the eliminating the pre-configuration required for OAuth to work.
> I want the Authorization URI and Access URI to be provided in the
> "WWW-Authentication: OAuth" header [other discovery options can give a
> vaguely similar result]. An OAuth library can then use these without needing
> to be specifically pre-configured to use this SP – as long as they don't
> involve SP-specific parameters such as Google's 'hd'.
> When the Authorization URI is provided dynamically in an SP response, the SP
> can insert the request token into this URI.

What about the oauth_callback parameter?

In many respects the request token URL and the authorization URL are
identical.  There's very little reason to prefer one over the other.
I happen to like adding parameters to the authorization URL, since it
encourages stateless request token implementations.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manger, James H  
View profile  
 More options Jun 30 2008, 9:11 pm
From: "Manger, James H" <James.H.Man...@team.telstra.com>
Date: Tue, 1 Jul 2008 11:11:29 +1000
Local: Mon, Jun 30 2008 9:11 pm
Subject: RE: [oauth] Re: Google OAuth support: hd authz parameter
Brian,

> What about the oauth_callback parameter?

oauth_callback is defined in the OAuth spec so an OAuth library will know how to use it. It is likely to be a fixed value for the life of a library instance (running app), or it will have a varying component that is internal to the library.

'hd' is specific to Google. An OAuth library will not know anything about it. An 'hd' value will need to be passed to the OAuth library. A different 'hd' value may be needed for each request.

I expect an app that can use OAuth to:
1. Initialize an OAuth library;
2. [Repeatedly] Send an HTTP request on behalf of a user.

An API for the 2nd step will have a URI as an input parameter.
Ideally that would be sufficient.
  doStuff(URL destination)

To support 'hd' in the Authorization URI, however,
the API for the 2nd step will need the URI and 'hd' as input parameters.
  doStuff(URL destination, String hd)   // Google-specific code

If the API is not Google-specific the 'hd' input will need to be in a more complicated structure.
  doStuff(URL destination, Map<String,String> authzParams)

That is only a little more onerous -- as long as the app is explicitly calling the OAuth code directly.

An alternative (and I suspect better) architecture is for an app to call the standard HTTP library for the language it is written in. OAuth would be implemented as a hook into the HTTP library. Java, for instance, has URLStreamHandlers, ContentHandlers, Authenticators, and CookieHandlers that plug-in "underneath" the URLConnection class. Most of the code in an app just uses the common URLConnection interface. Only initialization code needs to understand the details of any specialized authentication or other handling.

Passing 'hd' during initialization is ok.
Passing one URI for each request is expected.
Passing 'hd' separately from the URI for each request hinders the "nicest" API designs.

STATELESS REQUEST TOKEN
I am not sure what value a request token has if it doesn't encode any state?

James Manger


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brian Eaton  
View profile  
 More options Jun 30 2008, 9:36 pm
From: "Brian Eaton" <bea...@google.com>
Date: Mon, 30 Jun 2008 18:36:34 -0700
Local: Mon, Jun 30 2008 9:36 pm
Subject: Re: [oauth] Re: Google OAuth support: hd authz parameter
On Mon, Jun 30, 2008 at 6:11 PM, Manger, James H

<James.H.Man...@team.telstra.com> wrote:
> I expect an app that can use OAuth to:
> 1. Initialize an OAuth library;
> 2. [Repeatedly] Send an HTTP request on behalf of a user.

At some point it will need to redirect the user to get their permission.  Either
a) you build the redirection into the library or
b) you expose the authorization URL to clients of the library, since
they are the ones who have the browser focus

In a reusable library, you're only going to see the second option.

Re: the oauth_callback.  It is extremely common in web applications to
encode a certain amount of state in your callback URL, e.g. the user's
language, what page of your app they were on, etc...  All of that info
is dynamic.  There will be a few people out there with completely
static callback URLs, but they will be the exception, not the rule.

Re: stateless request tokens.  You can implement a request token and
token secret in two ways.
a) Write every request token to a persistent data store.
b) Encrypt the consumer identity (and whatever other information you
need) and use that as the request token

The second option scales better.  It is sometimes referred to as
"stateless", because it requires no frequently changing server-side
state to implement, just an encryption key.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manger, James H  
View profile  
 More options Jun 30 2008, 9:49 pm
From: "Manger, James H" <James.H.Man...@team.telstra.com>
Date: Tue, 1 Jul 2008 11:49:59 +1000
Local: Mon, Jun 30 2008 9:49 pm
Subject: RE: [oauth] Re: Google OAuth support: hd authz parameter
Just on the stateless part:

I was never suggesting writing an 'hd' value to a persistent data store.
I was suggesting receiving an 'hd' value in a Request Token URL then making it part of the token that is returned (just like you probably make the consumer identity part of the token). The app then passes the token (with the embedded 'hd' value) to the Authorization URL.

-> GET /oauth/request?hd=abc.edu
<- oauth_token=abc.edu,consumer.net,63gShg3jShg

<- 307 Redirect
   Location: ../oauth/authz?oauth_token=abc.edu,consumer.net,63gShg3jShg..

P.S. Please put a MAC on the token, not just encryption.

-----
Re: stateless request tokens.  You can implement a request token and
token secret in two ways.
a) Write every request token to a persistent data store.
b) Encrypt the consumer identity (and whatever other information you
need) and use that as the request token

The second option scales better.  It is sometimes referred to as
"stateless", because it requires no frequently changing server-side
state to implement, just an encryption key.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Manger, James H  
View profile  
 More options Jun 30 2008, 10:28 pm
From: "Manger, James H" <James.H.Man...@team.telstra.com>
Date: Tue, 1 Jul 2008 12:28:28 +1000
Local: Mon, Jun 30 2008 10:28 pm
Subject: RE: Google OAuth support: hd authz parameter

Brian,

I agree that a reusable OAuth library will return to the client with the Authorization URI, and that oauth_callback will often contain dynamic state.
This still doesn’t make an SP-specific ‘hd’ parameter in the Authorization URI the best choice.
Code building a dynamic app-specific callback URI doesn’t seem like an obvious place to also handle SP-specific parameters.
The ‘hd’ value will need to be passed to the code that gets the Authorization URI back, which is not necessarily the code that started the transaction (though I guess they both need to be coupled to the user’s browser request – [thanks for highlighting that]).

Taking a high-level view, OAuth is still about a user asking an app to access a URI.
A user asking an app to “access a URI and to use an extra ‘hd’ parameter during the process” is more complex.
Encoding ‘hd’ into the initial URI so the app does not need to know about it at all is simpler.

James Manger

_____________________________________________
From: oauth@googlegroups.com<mailto:oauth@googlegroups.com> [mailto:oauth@googlegroups.com]<mailto:[mailto:oauth@googlegroups.com]> On Behalf Of Brian Eaton
Sent: Tuesday, 1 July 2008 11:37 AM
To:
oauth@googlegroups.com
Subject<mailto:oa...@googlegroups.comSubject>: [oauth] Re: Google OAuth support: hd authz parameter

On Mon, Jun 30, 2008 at 6:11 PM, Manger, James H <James.H.Man...@team.telstra.com<mailto:James.H.Man...@team.telstra.com>> wrote:

> I expect an app that can use OAuth to:
> 1. Initialize an OAuth library;
> 2. [Repeatedly] Send an HTTP request on behalf of a user.

At some point it will need to redirect the user to get their permission.  Either
a) you build the redirection into the library or
b) you expose the authorization URL to clients of the library, since they are the ones who have the browser focus

In a reusable library, you're only going to see the second option.

Re: the oauth_callback.  It is extremely common in web applications to encode a certain amount of state in your callback URL, e.g. the user's language, what page of your app they were on, etc...  All of that info is dynamic.  There will be a few people out there with completely static callback URLs, but they will be the exception, not the rule.

Re: stateless request tokens.  You can implement a request token and token secret in two ways.
a) Write every request token to a persistent data store.
b) Encrypt the consumer identity (and whatever other information you
need) and use that as the request token

The second option scales better.  It is sometimes referred to as "stateless", because it requires no frequently changing server-side state to implement, just an encryption key.
_____________________________________________
From: oauth@googlegroups.com<mailto:oauth@googlegroups.com> [mailto:oauth@googlegroups.com]<mailto:[mailto:oauth@googlegroups.com]> On Behalf Of Manger, James H
Sent: Tuesday, 1 July 2008 11:50 AM
To:
oauth@googlegroups.com
<mailto:oa...@googlegroups.comSubject>
Just on the stateless part:

I was never suggesting writing an 'hd' value to a persistent data store.
I was suggesting receiving an 'hd' value in a Request Token URL then making it part of the token that is returned (just like you probably make the consumer identity part of the token). The app then passes the token (with the embedded 'hd' value) to the Authorization URL.

-> GET /oauth/request?hd=abc.edu
<- oauth_token=abc.edu,consumer.net,63gShg3jShg

<- 307 Redirect
   Location: ../oauth/authz?oauth_token=abc.edu,consumer.net,63gShg3jShg..

P.S. Please put a MAC on the token, not just encryption.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 29   Newer >
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google