PlanetTeamSpeakk/DevLogin

Could not login using Microsoft account.

Closed this issue · 3 comments

Whenever I started my project, it had the same error. If I deleted the cache, it let me log in again but then raised the error.

At first, it said this:

java.lang.NullPointerException: Cannot invoke "com.google.gson.JsonElement.getAsString()" because the return value of "com.google.gson.JsonObject.get(String)" is null
	at fabric.com.ptsmods.devlogin.MSA.lambda$reqMinecraftToken$12(MSA.java:292) ~[devlogin-3.4.1.jar:?]
	at fabric.com.ptsmods.devlogin.MSA.doRequest(MSA.java:384) ~[devlogin-3.4.1.jar:?]
	at fabric.com.ptsmods.devlogin.MSA.reqMinecraftToken(MSA.java:288) ~[devlogin-3.4.1.jar:?]
	at fabric.com.ptsmods.devlogin.MSA.login(MSA.java:120) ~[devlogin-3.4.1.jar:?]
	at fabric.com.ptsmods.devlogin.DevLogin.loginMSA(DevLogin.java:134) ~[devlogin-3.4.1.jar:?]
	at fabric.com.ptsmods.devlogin.DevLogin.modifyArgs(DevLogin.java:49) ~[devlogin-3.4.1.jar:?]
	at net.minecraft.client.main.Main.localvar$zjj000$devlogin$modifyArgs(Main.java:521) ~[minecraft-clientonly-project-root-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.1-v2.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:103) ~[minecraft-clientonly-project-root-1.20.2-net.fabricmc.yarn.1_20_2.1.20.2+build.1-v2.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:468) ~[fabric-loader-0.14.22.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.14.22.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.14.22.jar:?]
	at net.fabricmc.devlaunchinjector.Main.main(Main.java:86) ~[dev-launch-injector-0.2.1+build.8.jar:?]

After that, Modang's authlib raised an error regarding the authentication failure.

Based off of the error message, I think that it has to do with the login_with_xbox endpoint under reqMinecraftToken changing.

I ended up logging in again and it actually worked. I got a weird 405 error from the Minecraft client session library, but everything seemed to work anyway. I restarted again and everything was working as normal.

I have no clue why GSON decided to not work for a little while, but it seems that a cache clear and a few restarts gets it working. I'll update if anything breaks again.

And by the way, thank you so much for this library! It's a real blessing.

Definitely not an issue with GSON. This error means Microsoft API's are returning unexpected data which likely means they either changed something, or something broke. Hope it's temporary, but we'll see.
Last time something like this happened, the mod didn't work for like two months.

Yeah, that's what I thought too

Based off of the error message, I think that it has to do with the login_with_xbox endpoint under reqMinecraftToken changing.

I put a breakpoint at doRequest("POST", "https://api...") in order to see the return value, but it started working properly after I did that so I don't know what it returned (I'm guessing null).

Since there's no more activity and no one saying they are having the same issue, I am assuming this is resolved.