def __init__(self, client_id , client_secret,
access_token=None, refresh_token=None,
*args, **kwargs):
"""
Create a FitbitOauth2Client object. Specify the first 7 parameters if
you have them to access user data. Specify just the first 2 parameters
to start the setup for user authorization (as an example see gather_key_oauth2.py)
- client_id, client_secret are in the app configuration page
https://dev.fitbit.com/apps
- access_token, refresh_token are obtained after the user grants permission
"""
self.session = requests.Session()
self.client_id = client_id
self.client_secret = client_secret
self.token = {'access_token' : access_token,
'refresh_token': refresh_token}
self.oauth = OAuth2Session(client_id)
评论列表
文章目录