PiotrMachowski / Xiaomi-cloud-tokens-extractor

This tool/script retrieves tokens for all devices connected to Xiaomi cloud and encryption keys for BLE devices.
MIT License
3.17k stars 327 forks source link

Two-factor authentication doesn't work anymore #43

Open Pivek opened 2 years ago

Pivek commented 2 years ago

Hi, issue exactly the same as here https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor/issues/180 It seems that even after "succesful" authentication with "ok" message in browser issue still persists. It endlessly keeps asking me for two-factor authentication: image

erapade commented 1 year ago

Didn't work for me either, but all I needed to do was to use my "Xiaomi Account ID" instead of my email address. To get your "Xiaomi Account ID", just go to https://account.xiaomi.com/ and then choose "Personal info" in the left menu and there you shall find your "Xiaomi Account ID"

Note: I first executed the script using my email address and followed the URL for 2FA and finished the 2FA. I then tried to re-execute the script a couple of times but having the same problem as everyone else above. Then I tried to add my phone as a 2FA but that didn't work. Then I checked my "Xiaomi Account ID" using the method I described above and used that (instead of my email) in a last attempt when running the script and then it just worked like magic. I don't know if there's anything in this that matters, just mentioning it

--Edit-- Now when I try again it works with both my Xiaomi Account ID as well as with my email. Not sure what's going on, maybe there was something I did on the https://account.xiaomi.com site or it just needed some time. One thing I did was also doing a change in the Profile settings and giving myself a Nickname. No idea if that made any difference though

smoothlystable commented 1 year ago

Didn't work for me either, but all I needed to do was to use my "Xiaomi Account ID" instead of my email address. To get your "Xiaomi Account ID", just go to https://account.xiaomi.com/ and then choose "Personal info" in the left menu and there you shall find your "Xiaomi Account ID"

Note: I first executed the script using my email address and followed the URL for 2FA and finished the 2FA. I then tried to re-execute the script a couple of times but having the same problem as everyone else above. Then I tried to add my phone as a 2FA but that didn't work. Then I checked my "Xiaomi Account ID" using the method I described above and used that (instead of my email) in a last attempt when running the script and then it just worked like magic. I don't know if there's anything in this that matters, just mentioning it

--Edit-- Now when I try again it works with both my Xiaomi Account ID as well as with my email. Not sure what's going on, maybe there was something I did on the https://account.xiaomi.com site or it just needed some time. One thing I did was also doing a change in the Profile settings and giving myself a Nickname. No idea if that made any difference though

Thank you for posting this! Weirdly started working for me with email as well, not sure if it was that I tried with Account ID first, or if they changed something. Either way, thanks for posting this, it made me try again after not having it working for over a year!

tors-rus commented 11 months ago

I am change in the Profile settings and giving myself a Nickname and it works for me

marcosgdf commented 10 months ago

Tried it today and it does not work anymore. I've tried all your methods and none work.

grmelacz commented 9 months ago

@erapade User ID instead of username worked for me. Thanks a lot!

I have not set a nickname, so that probably affects nothing in this matter.

a-edakin commented 9 months ago

I found workaround - not sure if all steps are necessary but it worked:

  • login to xiaomi account from browser
  • go to Signing in and security - turn 2FA on/off
  • go to Privacy - site requests confirmation code again - fill it
  • do not close browser, stay sign in
  • run extractor

It worked 26.1.2022

Worked for me 15.12.2023

But I did something different

  1. Logged in mi account
  2. Tried to open "Privacy" tab and it requested 2FA by email again
  3. Run script again and it worked
2Dou commented 9 months ago
  1. Just login mi.com with browser
  2. Back to token_extractor.exe try again, 2FA disappeared. Login Successed.

Maybe ip is checked.

ttr commented 8 months ago

Will add my 2c. Had this issuse myself and was stuck. Make sure that Your account set up is done (added phone and email) - mine was not finished so i was able to log on but extractor was failing.

When You do - run extractor, follow MFA url, log on via browser, and after sucessfull login (keep browser open) re-run extractor - it should now detect active and valid session and pass.

Side note -> mfa is proabbly checked on IP level (as ive run python and browser on different machines but they are cokming via same network.

mnsasha commented 7 months ago

Same issue with 2FA. My workaround: 1) Login in xiaomi account (with id, but I don't know if it is important). 2) Start clicking on SignIn, Personal Info, Privacy, Accounts in random order. First Xiomi wants 2FA codes for these, but after 5-6 times it starts show profile sections without 2FA. 3) Login with extractor as usual (with id, but I don't know if it is important).

khannan31 commented 1 month ago

Worked for me by just using the xiaomi account id instead of email_id. Did not ask for the 2FA any longer

gyrospita commented 1 month ago

Using Windows tool here.

Tried many times with email and user ID, didn't work. Was referred to the 2FA by the tool, did that many times, no luck.

Left it sitting for 10 minutes after last attempt while adding a nickname to my account: Worked. So people, add a nickname and have a coffee before trying again.

I was running PiHole the whole time. Blocking on/off didn't make a difference