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

Custom MFA handler doesn't seem to work? #86

Open
cyberjunky opened this issue Dec 15, 2024 · 4 comments
Open

Custom MFA handler doesn't seem to work? #86

cyberjunky opened this issue Dec 15, 2024 · 4 comments

Comments

@cyberjunky
Copy link
Contributor

cyberjunky commented Dec 15, 2024

Opening a new ticket since the old one was closed and full of api changes.

It seems the garth.login method always returns None when a MFA enabled account is used and return_on_mfa=True

  result = self.garth.login(
      self.username, self.password, return_on_mfa=True
  )

I believe garth.login -> client.login which is http.login which points to sso.login
But http.login doesn't return the same args

Can you shed a light, see what I do wrong, or if there is a bug?

variable title is holding "MFA" in sso.login, but the returned dict never ends up in garth.login (= None)

Running with garth 0.5.2 btw, trying to adapt my example.py

@matin
Copy link
Owner

matin commented Dec 16, 2024

I'll take a look

@cyberjunky
Copy link
Contributor Author

Any luck in finding if there is an issue, and/or fix?

@cyberjunky
Copy link
Contributor Author

@matin I got it working, see PR #92 hope you can merge it, if it can be optimized please do ofcourse!

@nouser2013
Copy link

Out of curiosity, is there any way to use this in a web app context? Assuming I want to use GARTH to get an OAuth token set from Garmin, but I have the 2 step process where the GARTH http client and its last_resp content get destroyed after the sso.login() returns.

In other words, I'd like to have one web form for the users email and password, and then, after some time, I'd like to display a second web form expecting the MFA token input.

I tried pickleing the http client for fun and move it across the HTML form (yes, very bad idea, I know), but it also didn't work, of course.

Thanks.

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

No branches or pull requests

3 participants