From e71d22453ec70869f2f3c30043f97a53cc4ee374 Mon Sep 17 00:00:00 2001 From: Bastien Abadie Date: Sat, 27 Feb 2021 22:45:02 +0100 Subject: [PATCH] Fix new authentication update (#24) --- garmin_uploader/api.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/garmin_uploader/api.py b/garmin_uploader/api.py index 81a1e67..cb50f2e 100644 --- a/garmin_uploader/api.py +++ b/garmin_uploader/api.py @@ -6,7 +6,7 @@ URL_HOSTNAME = 'https://connect.garmin.com/modern/auth/hostname' URL_LOGIN = 'https://sso.garmin.com/sso/login' URL_POST_LOGIN = 'https://connect.garmin.com/modern/' -URL_PROFILE = 'https://connect.garmin.com/modern/proxy/userprofile-service/socialProfile/' # noqa +URL_PROFILE = 'https://connect.garmin.com/modern/currentuser-service/user/info' # noqa URL_HOST_SSO = 'sso.garmin.com' URL_HOST_CONNECT = 'connect.garmin.com' URL_SSO_SIGNIN = 'https://sso.garmin.com/sso/signin' @@ -148,7 +148,7 @@ def authenticate(self, username, password): if not res.ok: raise Exception("Login check failed.") garmin_user = res.json() - logger.info('Logged in as {}'.format(garmin_user['fullName'])) + logger.info('Logged in as {}'.format(garmin_user['username'])) return session @@ -213,7 +213,7 @@ def load_activity_types(self): return self.activity_types logger.debug('Fetching activity types') - resp = requests.get(URL_ACTIVITY_TYPES) + resp = requests.get(URL_ACTIVITY_TYPES, headers=self.common_headers) if not resp.ok: raise GarminAPIException('Failed to retrieve activity types')