Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

method amazfit - ValueError: Wrong E-mail or Password.Error: ['401'] #57

Closed
zibous opened this issue Jan 19, 2022 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@zibous
Copy link

zibous commented Jan 19, 2022

I created a Zepp account using the same email and password for my AMAZFIT GTR.
Zepp APP works.
method xiaomi works - but no auth_key

To login with your Zepp credentials, use --method amazfit parameter, get error:
ValueError: Wrong E-mail or Password.Error: ['401']

python3 huami_token.py --method amazfit --email ******* --password ******** --bt_keys

Result:

AUTH: https://api-user.huami.com/registrations/*******/tokens {
     'state': 'REDIRECTION', 
	 'client_id': 'HuaMi', 
	 'password': '********', 
	 'redirect_uri': 'https://s3-us-west-2.amazonws.com/hm-registration/successsignin.html', 
	 'region': 'us-west-2', 
	 'token': 'access', 
	 'country_code': 'US'
	 }

REDIRECT: ParseResult(scheme='https', 
                      netloc='s3-us-west-2.amazonws.com', 
		      path='/hm-registration/successsignin.html', 
					  params='', 
					  query='error=401&state=REDIRECTION&region=eu-central-1', fragment='') {
					     'error': ['401'], 
						 'state': ['REDIRECTION'], 
						 'region': ['eu-central-1']
					  }

Traceback (most recent call last):
  File "/Users/******/huami-token/huami_token.py", line 356, in <module>
    device.get_access_token()
  File "/Users/*****/huami_token.py", line 105, in get_access_token
    raise ValueError(f"Wrong E-mail or Password." \
ValueError: Wrong E-mail or Password.Error: ['401']

It looks like that the REDIRECT is the problem.

How can i fix this ?
Thanks

@argrento argrento self-assigned this Jan 19, 2022
@argrento argrento added the bug Something isn't working label Jan 19, 2022
@argrento
Copy link
Owner

I will check this and #55. Looks like they are related to each other.

@zibous
Copy link
Author

zibous commented Jan 19, 2022

@argrento
👍 thanks

It looks like that the zep app is connecting to: api-mifit-de2.huami.com.

Bildschirmfoto 2022-01-20 um 08 13 12

@zibous
Copy link
Author

zibous commented Jan 20, 2022

@argrento

Now it worked.

I installed the ZEPP app on my second cell phone and there I can reset the password before logging into the ZEPP account, then assigned a new password and with the new password I received the auth_key.

I haven't found any other way to reset the password using, - only the ZEPP app.

Getting access token with amazfit login method...
https://api-user.huami.com/registrations/.....
REDIRECT: ParseResult(scheme='https', netloc='s3-us-west-2.amazonws.com', path='/hm-registration/successsignin.html', params='', query='state=REDIRECTION&region=eu-central-1&access=****&country_code=AT&expiration=1643543397', fragment='') {'state': ['REDIRECTION'], 'region': ['eu-central-1'], 'access': ['****'], 'country_code': ['AT'], 'expiration': ['1643543397']}
Logging in...
Logged in! User id: *****
Getting linked wearables...

Thanks.

@zibous zibous closed this as completed Jan 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants