The-Fireplace-Minecraft-Mods / In-Game-Account-Switcher

This mod allows you to change your logged in account in-game, without restarting Minecraft.
https://modrinth.com/mod/in-game-account-switcher
GNU Lesser General Public License v3.0
78 stars 31 forks source link

Mod sometimes fails to login as Microsoft account #152

Closed MATRIX-feather closed 2 months ago

MATRIX-feather commented 3 months ago

This always happens a few days after a Microsoft account is added.

Using mod version is 9.0.0-beta.5, password encryption, and Fabric loader 0.15.11.

Related log:

[13:53:54] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Logging (Microsoft) as **********
[13:53:56] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Decrypting tokens...
[13:53:57] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting MCA to MCP... (stored)
[13:53:57] [IAS/WARN] (IAS/MicrosoftAccount) IAS: MCA is (probably) expired. Refreshing...
[13:53:57] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting MSR to MSA/MSR...
[13:53:58] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting MSA to XBL...
[13:53:59] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting XBL to XSTS...
[13:54:00] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting XSTS to MCA...
[13:54:00] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Converting MCA TO MCP... (refreshed)
[13:54:00] [IAS/INFO] (IAS/MicrosoftAccount) IAS: Encrypting tokens...
[13:54:00] [IAS/ERROR] (IAS/LoginPopupScreen) IAS: Login error.
java.lang.RuntimeException: Unable to login as MS account
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$12(MicrosoftAccount.java:422) ~[IAS-Fabric-1.20.6-9.0.0-beta.5.jar:?]
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to encrypt the tokens.
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:722) ~[?:?]
    ... 7 more
Caused by: java.lang.RuntimeException: Unable to encrypt the tokens.
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$11(MicrosoftAccount.java:400) ~[IAS-Fabric-1.20.6-9.0.0-beta.5.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
    ... 7 more
Caused by: java.lang.NullPointerException: Cannot invoke "ru.vidtu.ias.crypt.Crypt.encrypt(byte[])" because "val" is null
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$11(MicrosoftAccount.java:390) ~[IAS-Fabric-1.20.6-9.0.0-beta.5.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?]
    ... 7 more
VidTu commented 3 months ago

was broken here, will fix.

VidTu commented 3 months ago

should be fixed in 8f7be2b0bdead514c91a78edd29f3c4520d1197c. dev builds (mods JARs) will be available here in a few minutes. will release onto modrinth, curseforge, etc. in the future.

R00tB33rMan commented 3 months ago

should be fixed in 8f7be2b. dev builds (mods JARs) will be available here in a few minutes. will release onto modrinth, curseforge, etc. in the future.

Sometimes, during my first try, this issue still occurs. After try two, the issue does not recur with the latest development builds. Whereas previously, I had to continually re-add my accounts to permit working authentication

VidTu commented 3 months ago

share your logs then

R00tB33rMan commented 3 months ago

share your logs then


[17:55:31] [IAS/INFO]: IAS: Creating user...
[17:55:31] [Render thread/INFO]: IAS: Flushing user...
[17:55:31] [Render thread/INFO]: IAS: Flushed user.
[17:55:32] [IAS/INFO]: IAS: Logging (Microsoft) as e7059a6e-a90a-4dc6-8a8f-a21b44630fb2/Crosley
[17:55:32] [IAS/INFO]: IAS: Decrypting tokens...
[17:55:32] [IAS/INFO]: IAS: Converting MCA to MCP... (stored)
[17:55:33] [IAS/WARN]: IAS: MCA is (probably) expired. Refreshing...
[17:55:33] [IAS/INFO]: IAS: Converting MSR to MSA/MSR...
[17:55:33] [IAS/INFO]: IAS: Converting MSA to XBL...
[17:55:33] [IAS/INFO]: IAS: Converting XBL to XSTS...
[17:55:33] [IAS/INFO]: IAS: Converting XSTS to MCA...
[17:55:34] [IAS/ERROR]: IAS: Login error.
java.lang.RuntimeException: Unable to login as MS account
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$12(MicrosoftAccount.java:424) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:990) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$UniExceptionally.tryFire(CompletableFuture.java:974) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
    at java.base/java.lang.Thread.run(Thread.java:1570) [?:?]
Caused by: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to refresh MSR.
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:994) ~[?:?]
    ... 8 more
Caused by: java.lang.RuntimeException: Unable to refresh MSR.
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$8(MicrosoftAccount.java:355) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
    ... 9 more
Caused by: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to perform MSR auth.
    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.uniExceptionally(CompletableFuture.java:994) ~[?:?]
    ... 8 more
    Suppressed: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to convert Minecraft Access (MCA) token to Minecraft Profile (MCP) ((GET https://api.minecraftservices.com/minecraft/profile) 429): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215532Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhs9            </span>
        </div>
    </div>
</body>
</html>

        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:1570) [?:?]
    Caused by: java.lang.RuntimeException: Unable to convert Minecraft Access (MCA) token to Minecraft Profile (MCP) ((GET https://api.minecraftservices.com/minecraft/profile) 429): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215532Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhs9            </span>
        </div>
    </div>
</body>
</html>

        at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$mcaToMcp$6(MSAuth.java:514) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 7 more
    Caused by: java.lang.IllegalArgumentException: Invalid status code: 429
        at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$mcaToMcp$6(MSAuth.java:503) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 7 more
Caused by: java.lang.RuntimeException: Unable to perform MSR auth.
    at ru.vidtu.ias.account.MicrosoftAccount.lambda$login$7(MicrosoftAccount.java:351) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
    ... 9 more
Caused by: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to convert Xbox Secure Token Service (XSTS) token to Minecraft Access (MCA) token ((POST https://api.minecraftservices.com/authentication/login_with_xbox) 429 with java.net.http.HttpHeaders@942ba649 { {:status=[429], cache-control=[no-store], content-length=[1261], content-type=[text/html], date=[Tue, 04 Jun 2024 21:55:33 GMT], x-azure-ref=[20240604T215533Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhwd], x-cache=[TCP_MISS]} }): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215533Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhwd            </span>
        </div>
    </div>
</body>
</html>

    at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
    ... 7 more
    Suppressed: java.util.concurrent.CompletionException: java.lang.RuntimeException: Unable to convert Minecraft Access (MCA) token to Minecraft Profile (MCP) ((GET https://api.minecraftservices.com/minecraft/profile) 429): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215532Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhs9            </span>
        </div>
    </div>
</body>
</html>

        at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649) ~[?:?]
        at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[?:?]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317) ~[?:?]
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
        at java.base/java.lang.Thread.run(Thread.java:1570) [?:?]
    Caused by: java.lang.RuntimeException: Unable to convert Minecraft Access (MCA) token to Minecraft Profile (MCP) ((GET https://api.minecraftservices.com/minecraft/profile) 429): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215532Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhs9            </span>
        </div>
    </div>
</body>
</html>

        at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$mcaToMcp$6(MSAuth.java:514) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 7 more
    Caused by: java.lang.IllegalArgumentException: Invalid status code: 429
        at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$mcaToMcp$6(MSAuth.java:503) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
        at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
        ... 7 more
Caused by: java.lang.RuntimeException: Unable to convert Xbox Secure Token Service (XSTS) token to Minecraft Access (MCA) token ((POST https://api.minecraftservices.com/authentication/login_with_xbox) 429 with java.net.http.HttpHeaders@942ba649 { {:status=[429], cache-control=[no-store], content-length=[1261], content-type=[text/html], date=[Tue, 04 Jun 2024 21:55:33 GMT], x-azure-ref=[20240604T215533Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhwd], x-cache=[TCP_MISS]} }): <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>

<head>
    <meta content='text/html; charset=utf-8' http-equiv='content-type' />
    <style type='text/css'>
        body {
            font-family: Arial;
            margin-left: 40px;
        }

        img {
            border: 0 none;
        }

        #content {
            margin-left: auto;
            margin-right: auto
        }

        #message h2 {
            font-size: 20px;
            font-weight: normal;
            color: #000000;
            margin: 34px 0px 0px 0px
        }

        #message p {
            font-size: 13px;
            color: #000000;
            margin: 7px 0px 0px0px
        }

        #errorref {
            font-size: 11px;
            color: #737373;
            margin-top: 41px
        }
    </style>
    <title>Service unavailable</title>
</head>

<body>
    <div id='content'>
        <div id='message'>
            <h2>The request is blocked.</h2>
        </div>
        <div id='errorref'>
            <span>20240604T215533Z-1598d476d888xqqmgyg448hudc0000000qkg00000000fhwd            </span>
        </div>
    </div>
</body>
</html>

    at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$xstsToMca$5(MSAuth.java:470) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
    ... 7 more
Caused by: java.lang.IllegalArgumentException: Invalid status code: 429
    at ru.vidtu.ias.auth.microsoft.MSAuth.lambda$xstsToMca$5(MSAuth.java:458) ~[In-Game-Account-Switcher-9.0.0-SNAPSHOT-1.20.6.jar:?]
    at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?]
    ... 7 more
VidTu commented 3 months ago

your logs are a completely different issue. you are being rate-limited by Microsoft. if you're using some kind of VPN, disable it. if you're spamming with "login" button, don't. if not, create a new issue.

VidTu commented 2 months ago

fixed in 9.0.0.