OpenAuth icon indicating copy to clipboard operation
OpenAuth copied to clipboard

[BUG] IOException -> File not found

Open Wqsknijper opened this issue 3 years ago • 5 comments

Describe the bug My client keeps erroring with FileNotFound error.

To Reproduce No reproduce, I don't know why it happens to me while it doesn't happen to others using exactly the same code.

Expected behavior Simply logging in, without any error.

Screenshots Instead adding the error log

[12:09:52] [Alt Login Thread/INFO]: [STDERR]: fr.litarvan.openauth.microsoft.MicrosoftAuthenticationException: java.util.concurrent.ExecutionException: fr.litarvan.openauth.microsoft.MicrosoftAuthenticationException: I/O exception thrown during Microsoft HTTP requests
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithWebview(MicrosoftAuthenticator.java:144)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at nl.knijper.client.altmanager.AltLoginThread.createSession2(AltLoginThread.java:57)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at nl.knijper.client.altmanager.AltLoginThread.run(AltLoginThread.java:77)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: Caused by: java.util.concurrent.ExecutionException: fr.litarvan.openauth.microsoft.MicrosoftAuthenticationException: I/O exception thrown during Microsoft HTTP requests
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2073)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithWebview(MicrosoftAuthenticator.java:142)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	... 2 more
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: Caused by: fr.litarvan.openauth.microsoft.MicrosoftAuthenticationException: I/O exception thrown during Microsoft HTTP requests
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:112)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.HttpClient.readJson(HttpClient.java:95)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.HttpClient.getJson(HttpClient.java:56)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithTokens(MicrosoftAuthenticator.java:217)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.lambda$0(MicrosoftAuthenticator.java:160)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: Caused by: java.io.FileNotFoundException: https://api.minecraftservices.com/minecraft/profile
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2048)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:2043)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:2042)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1609)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:106)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	... 11 more
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: Caused by: java.io.FileNotFoundException: https://api.minecraftservices.com/minecraft/profile
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1993)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3221)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:261)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:100)
[12:09:52] [Alt Login Thread/INFO]: [STDERR]: 	... 11 more

Desktop (please complete the following information, if Self-Hosted):

  • OS: Windows 11
  • Java version: Oracle OpenJDK version 1.8.0_301
  • Version: OpenAuth version (newest and older version, tried both, same issue)

Additional context I've had this FileNotFound exception with both Webview and normal loginWithCredentials, it is the same profile API which is causing the error, though the loginWithCredentials error looked a bit different and a.f.a.i.k. had multiple links not working.

Wqsknijper avatar Dec 07 '22 14:12 Wqsknijper

Do you use 2af on your Microsoft account ?

Jachou-yt avatar Jan 16 '23 19:01 Jachou-yt

Do you use 2af on your Microsoft account ?

I think I do, yes. If that's the issue, would there be anything to do, not being disabling 2fa?

Wqsknijper avatar Jan 16 '23 20:01 Wqsknijper

You can use the LoginWebView : https://github.com/Litarvan/OpenAuth/blob/master/src/main/java/fr/litarvan/openauth/microsoft/MicrosoftAuthenticator.java#L135

Jachou-yt avatar Jan 16 '23 20:01 Jachou-yt

Using that already

Wqsknijper avatar Jan 17 '23 08:01 Wqsknijper

You can :

  1. Update your JDK.
  2. Change your JDK's version (for exeample i use the jdk 11.)

And send me your code pls.

Jachou-yt avatar Jan 17 '23 17:01 Jachou-yt