api.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:MMM-fitbit 作者: SVendittelli 项目源码 文件源码
def fetch_access_token(self, code, redirect_uri):

        """Step 2: Given the code from fitbit from step 1, call
        fitbit again and returns an access token object. Extract the needed
        information from that and save it to use in future API calls.
        the token is internally saved
        """
        auth = OAuth2Session(self.client_id, redirect_uri=redirect_uri)
        self.token = auth.fetch_token(
            self.access_token_url,
            username=self.client_id,
            password=self.client_secret,
            code=code)

        return self.token
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号