Hi, @Takashi and @yuvi, Thank You for your responses :)
I was able to complete the OAuth dance with my Google App Engine application :D But now I am faced with another issue when I try to access the API URL :'( I am sending the OAuth information via the Authorization header, but when I try to do a 'get_current_user()' I am getting an 'InvalidOAuthParametersError'.. I can't figure out which OAuth parameter is wrong :( I have looked at all the documentation I can find and I am sending all the parameters correctly.. Have you guys been able to use the 'get_current_user()' successfully? If you can you please share what your header and request looks like? I have posted my header info below, if you can find what I am doing wrong then that would be great Request Header: OAuth oauth_consumer_key="site.com", oauth_nonce="80265015", oauth_signature="my_signature", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1296411891", oauth_token="my_token", oauth_version="1.0" On my server I get this in the error log raise e InvalidOAuthParametersError Any help would be greatly appreciated. Thanks, Arun Shanker Prasad. On Jan 29, 1:30 am, yuvi <[email protected]> wrote: > Hi, > > I'm using it from an Opensocial Gadget and it seems to work OK. The > only thing I have notice is that even > when I use my Google account control panel to "Revoke access" the > token is still working. > > https://www.google.com/accounts/b/0/IssuedAuthSubTokens > > On Jan 28, 6:40 pm, Takashi SASAKI <[email protected]> wrote: > > > > > > > > > Hi, Arun > > > I also making an OAuth consumer with Google App Engine for Python. > > The consumer uses simplegeo oauth2 library. > > Here is my code snippet to get access token > > when called back just after authorization. > > > .... > > user_info.authorized_request_token = > > self.request.get("oauth_token") > > user_info.verifier = self.request.get("oauth_verifier") > > assert(user_info.request_token == > > user_info.authorized_request_token) > > request_token = > > oauth2.Token(user_info.request_token.__str__(), > > user_info.request_token_secret.__str__()) > > request_token.set_verifier(user_info.verifier.__str__()) # > > may not needed > > request = oauth2.Request.from_consumer_and_token(consumer, > > token=request_token, http_url = SP_ACCESS_TOKEN_URL) > > signature_method = oauth2.SignatureMethod_HMAC_SHA1() > > request.sign_request(signature_method, consumer, > > request_token) > > #self.response.out.write(request.to_header()) > > connection.request(request.method, SP_ACCESS_TOKEN_URL, > > headers=request.to_header()) > > response = connection.getresponse() > > response_read = response.read() > > access_token = oauth2.Token.from_string(response_read) > > user_info.access_token = access_token.key > > user_info.access_token_secret = access_token.secret > > user_info.put() > > .... > > > I hope it helps you somewhat. > > > Takashi SASAKI (@TakashiSasaki on Twitter) > > > On 1月29日, 午前1:28, Arun Shanker Prasad <[email protected]> > > wrote: > > > > Hi All, > > > > Background: > > > > I am trying to implement a web-service for my App Engine application > > > and authenticate the user using OAuth. For this I chose to use my App > > > Engine application as an OAuth service provider. > > > > My issue: > > > > I got the request token back from App Engine and I redirected my user > > > to authorize the token and user grants access, everything is working > > > fine up until this point. When I try to get the access token using the > > > token and verifier provided by posting info to 'https://app- > > > id.appspot.com/_ah/OAuthGetAccessToken', I am getting a 400 error back > > > and does not have any information regarding what went wrong :( > > > > I had used GData OAuth before on my client application and had similar > > > issues during development, but the response from Google's GData > > > service had a bit more information as to what was wrong and I was able > > > to get it working pretty easily. > > > > My question is has anyone tried using their App Engine application as > > > an OAuth service provider? (I tried googling for a sample and was not > > > able to find anything) > > > > I am using Google App Engine for Python. > > > > Thanks, > > > Arun Shanker Prasad. -- You received this message because you are subscribed to the Google Groups "Google App Engine" 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-appengine?hl=en.
