Built-in OAuth integration seems not to work for GAE Python

33 views
Skip to first unread message

Takashi SASAKI

unread,
Jan 28, 2011, 7:00:40 AM1/28/11
to Google App Engine
Hi, all.

I noticed that built-in OAuth support does work in GAE Java
but does not work in GAE Python.

My simple OAuth service providers are
http://pastebin.com/qJZEFE4C for GAE Python and
http://pastebin.com/N09TC9K6 for GAE Java.

Python version is at http://antanxi.appspot.com/oauth_sp
Java version is at http://sandbox-java.appspot.com/HelloServlet

I use the same OAuth consumer for both providers.
Am I missing something important in GAE Python version provider ?

Thanks

Takashi SASAKI (@TakashiSasaki in Twitter)

Takashi SASAKI

unread,
Jan 28, 2011, 9:09:39 PM1/28/11
to Google App Engine, Jean-Lou Dupont
I got it.

In Python version OAuth service provider,
hat causes exception is not oauth.get_current_user()
but oauth.get_oauth_consumer_key() .
The former works without exception.

In Java version OAuth service provider,
oauth.getOAuthConsumerKey() also throws exception.

Now I found another strange behavior.
oauth.get_current_user() returns "takashi316" in Python version
while oauth.getCurrentUser() returns "takas...@gmail.com" in Java
version.

Anyway I believe I could move forward. Thanks, all.

Jean-Lou Dupont, who had posted "OAuth integration issue with Google
Apps" in
http://groups.google.com/group/google-appengine/browse_frm/thread/b45e0f48568b5bb1/95fe61ab88a93f9d
,
also helped me personally. Thanks.

On Jan 28, 9:00 pm, Takashi SASAKI <takashi...@gmail.com> wrote:
> Hi, all.
>
> I noticed that built-in OAuth support does work in GAE Java
> but does not work in GAE Python.
>
> My simple OAuth service providers arehttp://pastebin.com/qJZEFE4Cfor GAE Python andhttp://pastebin.com/N09TC9K6for GAE Java.
>
> Python version is athttp://antanxi.appspot.com/oauth_sp
> Java version is athttp://sandbox-java.appspot.com/HelloServlet

Takashi SASAKI

unread,
Jan 28, 2011, 9:33:18 PM1/28/11
to Google App Engine
I found a post making mention of similar symptom.

Issue 3409:
When calling the oauth.get_oauth_consumer_key(),
OAuthRequestError exception always raises
http://code.google.com/p/googleappengine/issues/detail?id=3409

Takashi SASAKI (@TakashiSasaki on Twitter)

On Jan 29, 11:09 am, Takashi SASAKI <takashi...@gmail.com> wrote:
> I got it.
>
> In Python version OAuth service provider,
> hat causes exception is not  oauth.get_current_user()
> but oauth.get_oauth_consumer_key() .
> The former works without exception.
>
> In Java version OAuth service provider,
> oauth.getOAuthConsumerKey() also throws exception.
>
> Now I found another strange behavior.
> oauth.get_current_user() returns "takashi316" in Python version
> while oauth.getCurrentUser() returns "takashi...@gmail.com" in Java
> version.
>
> Anyway I believe I could move forward. Thanks, all.
>
> Jean-Lou Dupont, who had posted "OAuth integration issue with Google
> Apps" inhttp://groups.google.com/group/google-appengine/browse_frm/thread/b45...
> ,
> also helped me personally. Thanks.
>
> On Jan 28, 9:00 pm, Takashi SASAKI <takashi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi, all.
>
> > I noticed that built-in OAuth support does work in GAE Java
> > but does not work in GAE Python.
>
> > My simple OAuth service providers arehttp://pastebin.com/qJZEFE4CforGAE Python andhttp://pastebin.com/N09TC9K6forGAE Java.

Takashi SASAKI

unread,
Jan 30, 2011, 7:19:56 AM1/30/11
to Google App Engine
Hi, all

I'm still fighting with GAE built-in OAuth.

I noticed that when I sign WITHOUT access token,
my service provider recognizes consumer key.
But when I sign with access token, my service provider doesn't,
that is, it throws an exception.

Requesting with access token in my consumer :
request.sign_request(signature_method, consumer, access_token) # with
access_token
request.sign_request(signature_method, consumer, None) # WITHOUT
access_token

Getting OAuth user in my service provider :
oauth.getCurrentUser() // Java version
oauth.get_current_user() # Python version

Getting OAuth consumer key in my service provider :
oauth.getOAuthConsumerKey() // Java version
oauth.get_oauth_consumer_key() # Python version

Is it correct behavior ?

Thanks

Takashi SASAKI (@TakashiSasaki on Twitter)
Reply all
Reply to author
Forward
0 new messages