matin / garth

Garmin SSO auth + Connect Python client
MIT License
274 stars 20 forks source link

"Update Phone Number" when signin #19

Closed gooin closed 11 months ago

gooin commented 11 months ago

Thank you, @matin for your work on the this lib. I used your code as a basis for refactoring the garmin-connect which is a typescript lib for garmin connect https://github.com/Pythe1337N/garmin-connect/pull/56

When the account has a phone number, the library works fine. However, if the account doesn't have a phone number, the POST request during the sign-in step returns an HTML page with the title "Update Phone Number", which causes the login to fail. If everything goes well, the title should be "Success".

Does anyone know how to add a phone number to a Garmin account? I tried adding a phone number on the MFA page, but I still can't see the phone number on the https://www.garmin.com/en-US/account/profile/ page.

https://www.garmin.com/en-US/account/profile/

Have phone numbers account:

image

Doesn't have phone numbers account:

image

gooin commented 11 months ago

In https://github.com/Pythe1337N/garmin-connect/pull/56/commits/e82aa730357a08b23640991843fcbe7e825eb16f

matin commented 11 months ago

I see you're based in China, but it looks like you're using the Garmin US website. Have you tried using garmin.com.cn to enter the account?

Garmin is fairly specific about requiring requests from China to go through .cn domains. This was a fairly annoying part of the development, but a large number of the people using Garth are based in China.

I have some other ideas on what you could do, but I'd start there if, in fact, you're attempting access the account from China.

matin commented 11 months ago

On a separate note, it's amazing to see people like you migrating the Garth logic to other languages!

gooin commented 11 months ago

I see you're based in China, but it looks like you're using the Garmin US website. Have you tried using garmin.com.cn to enter the account?

Garmin is fairly specific about requiring requests from China to go through .cn domains. This was a fairly annoying part of the development, but a large number of the people using Garth are based in China.

I have some other ideas on what you could do, but I'd start there if, in fact, you're attempting access the account from China.

Yes, I'm in China. There are many users in China who want to use Strava, but Strava cannot connect to Garmin.cn. So we tried to register an account on Garmin.com to connect to Strava, and then transfer the .fit files from Garmin.cn to Garmin.com. This way, we can use Strava.

Today, I tried to reproduce this issue by registering a new account on connect.garmin.com. When I tried to log in using Garth's method, I also got the "Update Phone Number" prompt. I then tried logging in to the account using the Connect App, and after entering my password and clicking "Log In", the "Update Phone Number" page appeared. I entered my phone number and verified it, and then logged in using Garth's method, and everything worked fine.

I hope this helps anyone who encounters the same issue.

matin commented 11 months ago

Happy to hear it's resolved!