headlessmc icon indicating copy to clipboard operation
headlessmc copied to clipboard

Cannot login to microsoft account

Open averithefox opened this issue 1 year ago • 9 comments

Launching version 1.12.2, 21a8126f-3e16-433f-90b8-ff7da87d2730
me.earth.headlessmc.launcher.auth.AuthException: Invalid credentials or tokens
        at me.earth.headlessmc.launcher.auth.AccountManager.login(AccountManager.java:62)
        at me.earth.headlessmc.launcher.auth.AccountManager.login(AccountManager.java:40)
        at me.earth.headlessmc.launcher.launch.ProcessFactory.run(ProcessFactory.java:41)
        at me.earth.headlessmc.launcher.launch.ProcessFactory.run(ProcessFactory.java:34)
        at me.earth.headlessmc.launcher.command.LaunchCommand.execute(LaunchCommand.java:51)
        at me.earth.headlessmc.launcher.command.LaunchCommand.execute(LaunchCommand.java:19)
        at me.earth.headlessmc.launcher.command.FindByCommand.execute(FindByCommand.java:31)
        at me.earth.headlessmc.command.CommandContextImpl.executeCommand(CommandContextImpl.java:44)
        at me.earth.headlessmc.command.CommandContextImpl.execute(CommandContextImpl.java:31)
        at me.earth.headlessmc.command.line.ConsoleListener.listen(ConsoleListener.java:22)
        at me.earth.headlessmc.command.line.CommandLineImpl.listen(CommandLineImpl.java:26)
        at me.earth.headlessmc.launcher.Main.runHeadlessMc(Main.java:90)
        at me.earth.headlessmc.launcher.Main.main(Main.java:35)
Couldn't launch 1.12.2: Invalid credentials or tokens
[10:20:49] [main/INFO] [LaunchCommand]: Deleting 21a8126f-3e16-433f-90b8-ff7da87d2730

averithefox avatar Nov 10 '23 09:11 averithefox

Ran into an issue like this, turned out I needed to login to my Microsoft account on my web browser to add a secondary email address

alexking avatar Nov 13 '23 01:11 alexking

Ran into an issue like this, turned out I needed to login to my Microsoft account on my web browser to add a secondary email address

So adding secondary email and using it to login fixes the issue?

averithefox avatar Nov 13 '23 15:11 averithefox

Have you also checked whats going on at https://account.live.com/activity?

3arthqu4ke avatar Nov 18 '23 10:11 3arthqu4ke

Have you also checked whats going on at https://account.live.com/activity?

Incorrect password entered. My paassword is random sequence of characters, including for example \ this may couse errors?

averithefox avatar Nov 18 '23 15:11 averithefox

Oh I think so, will have to fix that. For now you have to escape every \ with another \, so \\. You also need to escape " with \.

3arthqu4ke avatar Nov 19 '23 10:11 3arthqu4ke

I'm having a similar issue:

$ docker run --rm -it 3arthqu4ke/headlessmc
$ hmc login [email protected] "passw0rd"
Logging in...
Failed to log you in: Invalid credentials or tokens
me.earth.headlessmc.launcher.auth.AuthException: Invalid credentials or tokens
        at me.earth.headlessmc.launcher.auth.AccountManager.login(AccountManager.java:62)
        at me.earth.headlessmc.launcher.command.login.LoginCommand.lambda$login$0(LoginCommand.java:56)
        at me.earth.headlessmc.launcher.command.login.LoginCommand.execute(LoginCommand.java:41)
        at me.earth.headlessmc.command.CommandContextImpl.executeCommand(CommandContextImpl.java:44)
        at me.earth.headlessmc.command.CommandContextImpl.execute(CommandContextImpl.java:31)
        at me.earth.headlessmc.launcher.QuickExitCliHandler.checkQuickExit(QuickExitCliHandler.java:47)
        at me.earth.headlessmc.launcher.Main.runHeadlessMc(Main.java:86)
        at me.earth.headlessmc.launcher.Main.main(Main.java:35)

Which, has my details redacted... but the output is identical. I've triple-checked the email and password, even copy/pasting from command-line into a web-login. My account has 2FA, so I suspect this is due to #90

fragmuffin avatar Dec 02 '23 05:12 fragmuffin

Yea, that may be the reason

averithefox avatar Dec 04 '23 09:12 averithefox

Oh I think so, will have to fix that. For now you have to escape every \ with another \, so \\. You also need to escape " with \.

Have you also tried this out?

3arthqu4ke avatar Dec 10 '23 00:12 3arthqu4ke

Oh I think so, will have to fix that. For now you have to escape every \ with another \, so \\. You also need to escape " with \.

Have you also tried this out?

Yea, I tried

averithefox avatar Dec 10 '23 18:12 averithefox