Open tompi72 opened 8 years ago
if you look at the code, your error is happening right here, so either STRAVA_CLIENT_ID or STRAVA_CLIENT_SECRET are not read correctly from the app.
def RetrieveAuthorizationToken(self, req, level):
code = req.GET.get("code")
params = {"grant_type": "authorization_code", "code": code, "client_id": STRAVA_CLIENT_ID, "client_secret": STRAVA_CLIENT_SECRET, "redirect_uri": WEB_ROOT + reverse("oauth_return", kwargs={"service": "strava"})}
response = requests.post("https://www.strava.com/oauth/token", data=params)
if response.status_code != 200:
raise APIException("Invalid code")
data = response.json()
authorizationData = {"OAuthToken": data["access_token"]}
# Retrieve the user ID, meh.
id_resp = requests.get("https://www.strava.com/api/v3/athlete", headers=self._apiHeaders(ServiceRecord({"Authorization": authorizationData})))
return (id_resp.json()["id"], authorizationData)
for me it works fine, and the local_settings.py contains the following:
STRAVA_CLIENT_SECRET = "608d25############################3c7d62a" STRAVA_CLIENT_ID = "#####" STRAVA_RATE_LIMITS = [30000]
I try to get a local tapiriik-server running and got Garmin and Dropbox set up successfully. But trying to add Strava always results in the following feedback after the OAuth-Dialog:
API-keys are all inserted, but the the answer from the Strava-server seems to be not what tapiriik is expecting...
Help would be very appreciated. I'm a runner - not an IT-professional ;)