实现 #3095 微软登录界面对 XBox 400 错误给予提示 (#3194)

This commit is contained in:
Burning_TNT
2024-07-22 23:06:20 +08:00
committed by GitHub
parent ad5b74d8c7
commit 74abecaae7

View File

@@ -112,8 +112,11 @@ public class MicrosoftService {
}
private MicrosoftSession authenticateViaLiveAccessToken(String liveAccessToken, String liveRefreshToken) throws IOException, JsonParseException, AuthenticationException {
String uhs;
XBoxLiveAuthenticationResponse xboxResponse, minecraftXstsResponse;
try {
// Authenticate with XBox Live
XBoxLiveAuthenticationResponse xboxResponse = HttpRequest
xboxResponse = HttpRequest
.POST("https://user.auth.xboxlive.com/user/authenticate")
.json(mapOf(
pair("Properties",
@@ -121,12 +124,11 @@ public class MicrosoftService {
pair("RpsTicket", "d=" + liveAccessToken))),
pair("RelyingParty", "http://auth.xboxlive.com"), pair("TokenType", "JWT")))
.retry(5)
.accept("application/json").getJson(XBoxLiveAuthenticationResponse.class);
.accept("application/json")
.getJson(XBoxLiveAuthenticationResponse.class);
String uhs = getUhs(xboxResponse, null);
uhs = getUhs(xboxResponse, null);
XBoxLiveAuthenticationResponse minecraftXstsResponse;
try {
minecraftXstsResponse = HttpRequest
.POST("https://xsts.auth.xboxlive.com/xsts/authorize")
.json(mapOf(