tcgoetz / GarminDB

Download and parse data from Garmin Connect or a Garmin watch, FitBit CSV, and MS Health CSV files into and analyze data in Sqlite serverless databases with Jupyter notebooks.
GNU General Public License v2.0
1.18k stars 142 forks source link

Password escaping issue #169

Closed jbrechtel closed 1 year ago

jbrechtel commented 1 year ago

Describe the bug When a password contains special characters then login may fail.

To Reproduce Steps to reproduce the behavior:

  1. Change your Garmin Connect password to include a "?" in it
  2. Put that password in your GarminDb config file
  3. Attempt to download activities or data using GarminDb
  4. See that login fails

Expected behavior Login should succeed

Additional context I believe you may need to perform URL escaping on the params included in the get operation here https://github.com/tcgoetz/GarminDB/blob/master/garmindb/download.py#L122 but I'm not positive, it's only a hunch.

Once I changed my password to not include any special characters then login worked. Note I had all of "?;#^+" in my password before.

tcgoetz commented 1 year ago

I'll look into it. The password isn't passed as query params on 122, its passed as data on 134. The Python requests module should handle things like URL encoding, but this could be a Garmin API issue.

tcgoetz commented 1 year ago

How is your password passed? Is your password in the config or in a secure store?

tcgoetz commented 1 year ago

Any chance your password had a quotation mark in it?

tcgoetz commented 1 year ago

login is now done through an external library in https://github.com/tcgoetz/GarminDB/releases/tag/v3.5.0 Closing bugs filed against the old login code.