Ejemplo n.º 1
0
 def context(self):
   service = oauth_helper.createDocsService(self.data)
   next = '%s?next=%s' % (self.redirect.urlOf('gdata_oauth_verify'),
                          self.request.GET.get('next','/'))
   url = oauth_helper.generateOAuthRedirectURL(
       service, self.data.user,
       next)
   context = {
       'approval_page_url': url,
       'page_name': 'Authorization Required',
   }
   return context
Ejemplo n.º 2
0
 def get(self):
   access_token = oauth_helper.getAccessToken(self.data.user)
   if access_token:
     url = self.redirect.urlOf('gdata_popup_oauth_verified')
   else:
     service = oauth_helper.createDocsService(self.data)
     next = '%s?next=%s' % (self.redirect.urlOf('gdata_oauth_verify'),
                            self.redirect.urlOf('gdata_popup_oauth_verified'))
     url = oauth_helper.generateOAuthRedirectURL(
         service, self.data.user,
         next)
   self.redirect.toUrl(url)
   return self.response
Ejemplo n.º 3
0
 def get(self):
   service = oauth_helper.createDocsService(self.data)
   oauth_helper.checkOAuthVerifier(service, self.data)
   next = self.request.GET.get('next','/')
   self.redirect.toUrl(next)
   return self.response