Esempio n. 1
0
	def post(self):
		user = Temp()
		acc = auth.Authenticator(config['auth'])
		token = acc.obtain_request_token()
		logging.info(token.__dict__)
		user.oauth_key = token.key
		user.oauth_secret = token.secret
		user.put()
		self.redirect(acc.build_authorize_url(token,'https://dropboxplayer.appspot.com/oauth_callback'))
Esempio n. 2
0
	def get(self):
		if self.request.get('oauth_token', None) is not None:
			user = Temp.all().filter('oauth_key =',self.request.get('oauth_token')).get()
			if user is not None:
				acc = auth.Authenticator(config['auth'])
				token = oauth.OAuthToken(user.oauth_key,user.oauth_secret)
				access_token = acc.obtain_access_token(token,'')
				logging.info(access_token.__dict__)
				user.access_key = access_token.key
				user.access_secret = access_token.secret
				user.put()

				self.d['session'].regenerate_id()
				self.d['session']['user'] = user
				self.redirect('/home')