-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to new auth flow and use Garth, fixes #103 #104
Conversation
@SimonBaars love this! Why not use
Take a look at how Garth is being used in garminconnect I'm the maintainer of Garth. Let me know how I can be helpful. |
If you're looking to download an activity, you can use |
Hey @matin, good to have you around! FYI, I implemented Garth in a couple of affected repos:
I agree that using those Garth features as well would be better, but for now I wanted to stick as close as possible to the original implementation to not make it a too great diff at once (and also not too dependent on Garth, in case any of the maintainers would prefer a different direction later). We can always make it a separate effort 😄 |
I changed the PR title to reflect that the main goal is to fix auth. |
Fair point, and thanks for the work on the migrations! |
Thanks for the contribution. I need to understand the implications better though. |
Responded in #102 |
The "old authentication flow" (the one used by the web browser) is not shut down, but Garmin Connect uses Cloudflare's bot protection to prevent scripted access. That's why trying to replicate browser requests with One solution that resolves the present 403 (Forbidden) issue on my end is to use curl_cffi, a With that, the "old" (browser-based) authentication flow that My main objection against So for the time being I feel quite hesitant to merge this PR. |
@petergardfjall Interesting, when I tried using the old login portal manually via Chrome I couldn't get a session either. It gave me a Were you able to get a working |
@SimonBaars if you look at my comment at pe-st/garmin-connect-export#95 (comment), when I login manually via chrome, I Also did get a SESSIONID cookie, but it was further down the flow rather than earlier. |
For reasons stated here I will not merge this PR. Appreciate the contribution and discussion though. |
For full context, see the relevant issue thread: pe-st/garmin-connect-export#95
TLDR: Garmin shut down the old authentication flow. The new authentication flow has many security measures in place to script the login. The solution described in issue #102 works and we can use the Garth library to implement an OAuth flow, which should be more robust than the original method.
The OAuth flow also required using the new endpoints (which could be migrated by simply removing the proxy).
Thanks to @geraudloup for investigating this with me, and @app4g for the support!