Skip to content
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

Add support for MFA #136

Closed
wants to merge 1 commit into from
Closed

Add support for MFA #136

wants to merge 1 commit into from

Conversation

cam-rod
Copy link

@cam-rod cam-rod commented Apr 19, 2023

Made a patch for this a while ago, so I got around to formalizing it. Checks if the server requested an MFA code, and if so calls a function to request it from the user. Tested successfully on my account and closes #129 .

Only major drawback is that it requires interactive input, so I used a timed prompt to make sure automated scripts don't get stuck forever.

@cyberjunky
Copy link
Owner

@cam-rod very nice, I had this on my TO-DO list for a long time while finding some time... Will have a look and merge it soon, thanks again! Now I need to/can adapt the home-assistant integration too ;-)

@cuu508
Copy link

cuu508 commented Jul 16, 2023

FWIW I just tested this, and it worked with my account too.

@Cloud9Developer
Copy link

I wonder, maybe we can add a wait for the emailed code, pull it, then use that to automate the entire process?

@cam-rod
Copy link
Author

cam-rod commented Jul 18, 2023

Sounds like an good idea. It would involve setting up email authentication (ex. generating an app password for Gmail) and grabbing the right email. I don't have time to work on that, but if you want to fork off my branch feel free to do so.

@Cloud9Developer
Copy link

Retrieving the email and getting the code was easy honestly. I'm working on a withings to garmin sync. Basically merging 2 repos into one (yours and another lol). It's gonna be pretty ugly honestly, but just want it to work haha.

@cuu508
Copy link

cuu508 commented Jul 18, 2023

Sorry for offtopic, but, @Cloud9Developer, do you really need to merge the repos together? Couldn't you have a third project, which uses the two libraries as dependencies?

I made a small, quick script that syncs weight data from Fitbit to Garmin Connect. It's a single script, plus garminconnect and fitbit in requirements.txt. (The script nominally works, except due to Garmin's MFA and Fitbit's access tokens expiring, it is hard to automate, which was the whole point)

@Cloud9Developer
Copy link

What I'm doing is pushing everything to a separate repo to make one project, then later on will reduce it down to more specific code.

For now, I'm just wanting the functionality to work lol

@matin
Copy link
Contributor

matin commented Sep 19, 2023

This can be closed without merging. The current version of garminconnect already includes MFA support

@cyberjunky cyberjunky closed this Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is 2FA taken into consideration ?
5 participants