nokia-weight-sync icon indicating copy to clipboard operation
nokia-weight-sync copied to clipboard

Withings Registration not working

Open dsonenberg opened this issue 5 years ago • 1 comments

Hey,

I just tried setting up an application with Withings but it doesn't seem to be working. They changed their requirements on call back, and localhost is no longer working. I tried using an ddns URL i have but that gives an "Internal error" message. Do you know any tricks to getting this working?

dsonenberg avatar Oct 14 '19 17:10 dsonenberg

In the nokia.py file. I added include_client_id=True, to line 85. This allows the function to work (nokia requires the client_id be sent now).

This is what the function call looks like now:

def get_credentials(self, code):
        tokens = self._oauth().fetch_token(
            '%s/oauth2/token' % self.URL,
            include_client_id=True,
            code=code,
            timeout=2,
            client_secret=self.consumer_secret)
        return NokiaCredentials(
            access_token=tokens['access_token'],
            token_expiry=str(ts()+int(tokens['expires_in'])),
            token_type=tokens['token_type'],
            refresh_token=tokens['refresh_token'],
            user_id=tokens['userid'],
            client_id=self.client_id,
            consumer_secret=self.consumer_secret,
        )

ossgeek314 avatar Dec 27 '19 13:12 ossgeek314