cyberjunky / python-garminconnect

Python 3 API wrapper for Garmin Connect to get activity statistics
MIT License
908 stars 142 forks source link

Cannot login #164

Closed andgineer closed 1 year ago

andgineer commented 1 year ago

With the same code that worked before

api = Garmin(email, password)
api.login()

interactive login with this password works

latest version garminconnect 0.2.8

error garminconnect/init.py", line 382, in authenticate self.display_name = user_prefs["displayName"]

matin commented 1 year ago

I can't reproduce the issue.

Could you record a VCR cassette either here or for Garth showing what responses you're receiving?

The easiest way would be:

  1. fork Garth
  2. delete cassette for test_login_success
  3. record the cassette again. conftest.py should filter out all sensitive content in the requests and responses
  4. git push

Using the cassette, I can see what's going on; otherwise, there's no way to see what the issue is in your case.

andgineer commented 1 year ago

hm do not understand that - all 200 in the cassette https://github.com/andgineer/garth/blob/main/tests/cassettes/test_login_success.yaml

cyberjunky commented 1 year ago

Did it work before on version 0.2.x? I saw some people reporting similar issues in my Home Assistant integration https://github.com/cyberjunky/home-assistant-garmin_connect, could it be a Garmin service down issue? People on Reddit reported some issues with app as well..

cyberjunky commented 1 year ago

Have this issue myself as well on my dev Blue, will investigate

andgineer commented 1 year ago

I got it on 0.1.50 and upgraded to the latest thinking it will help

cyberjunky commented 1 year ago

I got it on 0.1.50 and upgraded to the latest thinking it will help

That is strange, because 0.2.x versions use a completely new way of fetching data from Garmin, do you have Garmin app working fine, and do you have MFA enabled by any chance?

andgineer commented 1 year ago

I do not know what is Garmin app - mobile? it works Garmin Connect site and my Garmin watch works fine, no MFA

debugging the lib I see that params = {"ticket": found.group(1)} # there is some ticket code response = self.modern_rest_client.get("", params=params)

do not return VIEWER_USERPREFERENCES but some very strange page with a lot of js

andgineer commented 1 year ago

oops I am very sorry I mixed my venvs and used the one with 0.1.50 version

With the latest version it works