mindstorm38 / portablemc

A fast, reliable and cross-platform command-line Minecraft launcher and API for developers. Including fast and easy installation of common mod loaders such as Fabric, Forge, NeoForge and Quilt.
https://pypi.org/project/portablemc/
GNU General Public License v3.0
320 stars 19 forks source link

Unable to login with Microsoft's secondary alias email #206

Open xhayper opened 3 months ago

xhayper commented 3 months ago

When trying to log in using Microsoft's alias email feature, the following error show up.

[  ..  ] Processing authentication against Minecraft services...
[FAILED] Incoherent authentication data, please retry.

I tried logging in with the Minecraft launcher and was able to login

xhayper commented 3 months ago

Caused by https://github.com/mindstorm38/portablemc/blob/e98452a9bf0915d89f64d688e78e2de0dfb8f9fa/portablemc/auth.py#L263

id_token_payload["email"].casefold() == email.casefold()

The payload return the primary alias instead of the email we used to login

xhayper commented 3 months ago

image Did some more digging and it turns out the email scope return the primary email

mindstorm38 commented 3 months ago

I made this so users could not login with another account than the one they specified in the command line. Didn't know that alias existed..