From beeb052b36a4b278c5d36d48fdf73d4a08118462 Mon Sep 17 00:00:00 2001 From: petergardfjall Date: Tue, 16 Apr 2019 20:04:18 +0200 Subject: [PATCH] garmin login endpoint has changed --- garminexport/garminclient.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/garminexport/garminclient.py b/garminexport/garminclient.py index 0a5edc9..8fcad4b 100755 --- a/garminexport/garminclient.py +++ b/garminexport/garminclient.py @@ -37,7 +37,7 @@ log = logging.getLogger(__name__) # reduce logging noise from requests library logging.getLogger("requests").setLevel(logging.ERROR) -SSO_LOGIN_URL = "https://sso.garmin.com/sso/login" +SSO_LOGIN_URL = "https://sso.garmin.com/sso/signin" """The Garmin Connect Single-Sign On login URL.""" @@ -110,8 +110,9 @@ class GarminClient(object): request_params = { "service": "https://connect.garmin.com/modern" } + headers={'origin': 'https://sso.garmin.com'} auth_response = self.session.post( - SSO_LOGIN_URL, params=request_params, data=form_data) + SSO_LOGIN_URL, headers=headers, params=request_params, data=form_data) log.debug("got auth response: %s", auth_response.text) if auth_response.status_code != 200: raise ValueError(