I'm following the tutorial for the Python API here:
http://code.google.com/apis/calendar/docs/1.0/developers_guide_python.html#Auth

I can successfully request a token, authenticate, and get back to the
page with the token (which looks like a 24 character string). But on
trying to upgrade it (using UpgradeToSessionToken) or calling
AuthSubTokenInfo, I get a NonAuthSubToken error.

Thanks

Sample code follows:
#!/usr/bin/python
import cgi
import cgitb
cgitb.enable()
#Google imports:
try:
  from xml.etree import ElementTree # for Python 2.5 users
except ImportError:
  from elementtree import ElementTree
import gdata.calendar.service
import gdata.service
import atom.service
import gdata.calendar
import atom
import getopt
import sys
import string
import time


form = cgi.FieldStorage()
authsub_token = form.getvalue('token')

if authsub_token == None:
    def GetAuthSubUrl():
      next = 'http://www.srcf.ucam.org/~tak27/gauthtest.cgi'
      scope = 'http://www.google.com/calendar/feeds/'
      secure = False
      session = True
      calendar_service = gdata.calendar.service.CalendarService()
      return calendar_service.GenerateAuthSubURL(next, scope, secure,
session);
    authSubUrl = GetAuthSubUrl();
    print "Location: %s\n" % authSubUrl
else:
    print "Content-type: text/html\n"
    calendar_service = gdata.calendar.service.CalendarService()
    calendar_service.auth_token = authsub_token
    print calendar_service.auth_token
    print calendar_service.AuthSubTokenInfo()
    calendar_service.UpgradeToSessionToken()

--~--~---------~--~----~------------~-------~--~----~
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://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to