Example #1
0
  def getFriends(self, userID):
        config = db_api.getConfig(self.request.host_url)
        assert config.api_key
	token = self.request.get('accessToken')
	reqUri = 'https://www.googleapis.com/plus/v1games/people/me/people/recommended';
	reqUri += '?key=' + config.api_key;
	reqUri += '&access_token=' + token;
	result = fetchjson(reqUri, None)
	self.response.write(tojson(result))
Example #2
0
  def get(self):
     config = db_api.getConfig(self.request.host_url)
     if not config:
       self.request_init()
       return

     redirectUri = '%s/logup.html' % self.request.host_url
     authScope = 'https://www.googleapis.com/auth/userinfo.profile+https://www.googleapis.com/auth/userinfo.email+https://www.googleapis.com/auth/plus.me+https://www.googleapis.com/auth/plus.people.recommended';
     returnto = self.request.get('redirect_uri')
     authUri = 'http://accounts.google.com/o/oauth2/auth'
     authUri += '?scope=' + authScope
     authUri += '&redirect_uri=' + redirectUri
     authUri += '&response_type=token'
     authUri += '&client_id=' + str(config.client_id)
     #authUri += '&state=' + returnto

     self.response.headers['Access-Control-Allow-Origin'] = '*'
     logging.debug('authUri=%s' % authUri)
     self.redirect(authUri)