コード例 #1
0
ファイル: handler.py プロジェクト: codeminders/m-distance
  def get(self):
    fitbit_oauth = util.create_fitbit_oauth_service()
    
    request_token, request_token_secret = fitbit_oauth.get_request_token(header_auth=True)

    #store token and secret in DB
    userid = util.load_session_credentials(self)[0]

    token_info = OAuthRequestToken(key_name=userid)
    token_info.request_token=request_token
    token_info.request_token_secret=request_token_secret
    token_info.put()

    authorize_url = fitbit_oauth.get_authorize_url(request_token)

    # Perform the redirect.
    self.redirect(str(authorize_url))