Raistlfiren / garmin-csv-plan

A quick n' dirty way of "automating" training plans into Garmin Connect.
https://raistlfiren.github.io/garmin-csv-plan/
37 stars 6 forks source link

Authentication failed #20

Closed fhuonder closed 3 years ago

fhuonder commented 3 years ago

Hi,

It does always abort with an error that the authentication failed.

In GarminConnect.php line 158:

  Authentication failed - please check your credentials (<html lang="en-US" class="no-js" xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta charset="utf-8" />
    <title>Garmin: Maintenance</title>

...

The credentials are correct, I tried on the garmin web page to verify.

Any hints?

Regards, Florian

Raistlfiren commented 3 years ago

@fhuonder - Thanks for posting. I believe it is in regards to the following issue - https://github.com/10REM/php-garmin-connect/issues/57

I updated the composer.json file to use the latest version of the libaray (1.7), and I need to troubleshoot the docker images to resolve the SSL issue. I will try to post back soon once I find a resolution to those images.

Raistlfiren commented 3 years ago

@fhuonder - I was unable to figure out the root issue of the problem, but I switched the Docker images to use Ubuntu instead of Alpine linux for the SSL hand-off. It seems as though that resolves the issue.

You will need to re-build the images by running docker-compose build --no-cache garmin and then running the program again. Please see if that works.

stevenbitner commented 3 years ago

@Raistlfiren it does not fix it for me. I tried on my Mac as well as through Docker with your latest (after rebuild) and still get the error:

Authentication failed - please check your credentials

Raistlfiren commented 3 years ago

@stevenbitner - Are you getting any other error at all? Like a 1020 error or anything else? Can you access this page on your computer? https://sso.garmin.com/sso/login?service=https%3A%2F%2Fconnect.garmin.com%2Fmodern%2F&webhost=https%3A%2F%2Fconnect.garmin.com&source=https%3A%2F%2Fconnect.garmin.com%2Fen-US%2Fsignin&clientId=GarminConnect&gauthHost=https%3A%2F%2Fsso.garmin.com%2Fsso&consumeServiceTicket=false

Thanks!

stevenbitner commented 3 years ago

I can access the link. After entering the same credentials that I put in .env the page title reads "Success". I do get a 1020 error.

Raistlfiren commented 3 years ago

@stevenbitner - So I ran the program on two pcs in two different locations, and it does seem to work. Can you do the following?

  1. git pull to make sure everything is at the latest version
  2. docker-compose build --no-cache garmin (or garmin-dev) - This rebuilds the Docker cache and image (Just to make sure it is now using the Ubuntu Docker image instead of the Alpine image)
  3. docker-compose run garmin composer update - This runs a composer update (You need to have dawguk/php-garmin-connect ^1.7.0 installed)
  4. Try running the command to import workouts
stevenbitner commented 3 years ago

I re-cloned and ran the commands you posted above. Worked well. I now have a 400 error, but I tried with a simple training plan and it worked, so it must be a small formatting error that I'll need to resolve. Thanks a ton for the help.

stevenbitner commented 3 years ago

After a few attempts to resolve format issues, the authentication error is back. So perhaps there is some throttling on Garmin's end as well.

fhuonder commented 3 years ago

Thanks for the fix. For me it works without any problems.

Raistlfiren commented 3 years ago

@stevenbitner - Maybe try a VPN or a different IP to see if that changes the issue you are running into.

Raistlfiren commented 3 years ago

I am closing this. Please re-open if this is still an issue.