Hey Josephine, Alright, if you're following the documentation here: http://code.google.com/apis/gdata/docs/auth/oauth.html#Examples
and still can't get it, why don't you attach your full, unedited source for this OAuth stuff, and I'll modify it to work. I realize this stuff can be pretty difficult to work with at first. The only thing I can think that is wrong in what you've pasted back is somehow the load call failed, but I can't be sure. Thanks, -Vic On Sat, Dec 11, 2010 at 4:45 PM, Josephine Feldhoff <[email protected]>wrote: > Hi again > Sorry about all of this questions > > I changed to use the client instead since that seems like the right version > to use, but get invalid token.... > > client = gdata.spreadsheets.client.SpreadsheetsClient(auth_token=token) > > But when I tried to get a feed I get > > gdata/client.py", line 308, in request > response, Unauthorized) > Unauthorized: Unauthorized - Server responded with: 401, <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> > > > > > > On Sat, Dec 11, 2010 at 21:17, Vic Fryzel <[email protected]> wrote: > >> Hey Josephine, >> >> So there are two options: >> >> 1. Recreate the old style token after you load the new style one back >> from App Engine, then use the old style token. >> 2. Use the Spreadsheets v3 client, >> gdata.spreadsheet*s*.client.SpreadsheetsClient, >> which uses the new style token, allowing you to avoid all of this token >> translation business. >> >> Thanks, >> -Vic >> >> >> >> On Sat, Dec 11, 2010 at 3:10 PM, Josephine Feldhoff < >> [email protected]> wrote: >> >>> Hi Vic >>> >>> Thanks a lot. That was the one to get things saved. >>> >>> But in the next step when I try to use the token with my >>> spreadsheet.service client I get the following error >>> >>> self.service_client.token_store >>> =gdata.gauth.AuthSubToken(tokenSpread.get_token_string(), >>> ['https://spreadsheets.google.com/feeds/' >>> <https://spreadsheets.google.com/feeds/%27>]) >>> AttributeError: 'AuthSubToken' object has no attribute 'get_token_string' >>> >>> >>> The code I'm trying.... >>> client = gdata.spreadsheet.service.SpreadsheetsService() >>> gdata.alt.appengine.run_on_appengine(service_client) >>> token = token = gdata.gauth.ae_load(current_user.user_id()) >>> client.token_store =tokenSpread >>> client.auth_token = tokenSpread >>> client.UpgradeToSessionToken() >>> >>> feed = self.service_client.GetSpreadsheetsFeed() >>> >>> Another variant >>> >>> client.token_store =gdata.gauth.AuthSubToken(token.get_token_string(), >>> ['https://spreadsheets.google.com/feeds/' >>> <https://spreadsheets.google.com/feeds/%27>]) >>> >>> I cant figure out how to add the token . I've tried to figure out which >>> version the service is using. The "old style" or the new one >>> >>> >>> >>> >>> On Fri, Dec 10, 2010 at 22:41, Vic Fryzel <[email protected]> wrote: >>> >>>> Hey Josephine, >>>> >>>> Ah, I found the issue. You're using the "old style" AuthSubToken class, >>>> which is defined as gdata.auth.AuthSubToken, yet the method you're using >>>> (ae_save()) uses the "new style" AuthSubToken class, which is defined as >>>> gdata.gauth.AuthSubToken. Note the g in gauth. >>>> >>>> Replace line 68 in what you sent me with this: >>>> new_style_token = gdata.gauth.AuthSubToken(token.get_token_string(), [' >>>> https://spreadsheets.google.com/feeds/'<https://spreadsheets.google.com/feeds/%27> >>>> ]) >>>> gdata.gauth.ae_save(new_style_token, current_user.user_id()) >>>> >>>> And you should be good to go. >>>> >>>> Thanks, >>>> -Vic >>>> >>> >>> >>> >>> -- >>> Co-founder and owner >>> +46 704 330 764 >>> Cloudspot AB >>> www.cloudspot.se >>> Google Apps Authorized Reseller >>> >>> >> > > > -- > Co-founder and owner > +46 704 330 764 > Cloudspot AB > www.cloudspot.se > Google Apps Authorized Reseller > >
