Skip to content

fix: Two-factor authentication #126

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Cerallin
Copy link

@Cerallin Cerallin commented May 7, 2025

This PR fixes 2FA with reference to xiaomi_miot.

I am in a hurry to use it, so the code quality is not good enough. Welcome to request changes.

Executables for those in a hurry: https://github.com/Cerallin/Xiaomi-cloud-tokens-extractor/releases/tag/fix-2fa

Ref: #43, #124, #125, al-one/hass-xiaomi-miot/issues/#2465

@vdemidov
Copy link

vdemidov commented May 7, 2025

Sorry, but where can be found token after 2fa request?

@Cerallin
Copy link
Author

Cerallin commented May 7, 2025

Sorry, but where can be found token after 2fa request?

When it shows a URL as below, open it in a browser:

Logging in...
Two factor authentication required, please use following url:
https://account.xiaomi.com/identity/authStart?sid=xiaomiio&context=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Take mine as an example, click the big button to send a code to my phone. Input the code to cli (NOT IN THE BROWSER). And it works for me.

image

@vdemidov
Copy link

vdemidov commented May 7, 2025

Input the code to cli (NOT IN THE BROWSER).

This is the key point :)
Thank you!

@hamwong
Copy link

hamwong commented May 7, 2025

it works, thank you

@scegg
Copy link

scegg commented May 9, 2025

Thanks a lot. It works like a charm.

@andrea271988
Copy link

Where i have to insert the code?? if i insert it in the prompt nothing appens

@Cerallin
Copy link
Author

Where i have to insert the code?? if i insert it in the prompt nothing appens

Where did you input the code? Is there any screenshots?

@bsdshneg
Copy link

roborock_s5_max
I run the script on Linux in my home network (external address is the same), get the code, enter it into the console and get a list of devices with tokens BUT! I already know the tokens, they haven't changed, and the map-extractor still requests 2fa.

@Cerallin
Copy link
Author

Cerallin commented May 12, 2025

I already know the tokens, they haven't changed, and the map-extractor still requests 2fa.

@bsdshneg This script is only for extracting Xiaomi cloud tokens. If you're encountering issues with map extraction, it might be related to a different tool. Maybe Xiaomi Cloud Map Extractor? I guess.

@Misaka-0x447f
Copy link

works for me, 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

Successfully merging this pull request may close these issues.

7 participants