Code Monkey home page Code Monkey logo

openauth's Introduction

OpenAuth Logo

Minecraft authentication library which supports both Mojang and Microsoft accounts, or even custom servers

Credits

This project would have not existed without the work from:

Importing library

Gradle

repositories {
    maven {
        url 'https://litarvan.github.io/maven'
    }
}

dependencies {
    implementation 'fr.litarvan:openauth:1.1.3'
}

Maven

<repositories>
    <repository>
        <id>litarvan</id>
        <url>https://litarvan.github.io/maven</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>fr.litarvan</groupId>
        <artifactId>openauth</artifactId>
        <version>1.1.3</version>
    </dependency>
</dependencies>

Other

Use the JAR file from releases, or from the GitHub Actions.

How to use it (Microsoft)

MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
MicrosoftAuthResult result = authenticator.loginWithCredentials("email", "password");
      // Or using a webview: authenticator.loginWithWebView();
  // Or using refresh token: authenticator.loginWithRefreshToken("refresh token");
   // Or using your own way: authenticator.loginWithTokens("access token", "refresh token");
        
System.out.printf("Logged in with '%s'%n", result.getProfile().getName());

You can save the refresh token (result.getRefreshToken()) to log back the user silently later.

How to use it (Mojang)

Use it to connect to any yggdrasil server (The Mojang official auth server, or any openauth server, and maybe other servers !)

Init it

First init the authenticator with settings from your server :

AuthPoints points = new AuthPoints("authpage", "refreshpage", "validatepage", "signoutpage", "invalidatepage");
Authenticator authenticator = new Authenticator("urlofyourserver", points);

So the auth points are the url (relative to the main url) of all your page, you can give only page that you wan't to use ! urlofyourserver is of course the URL of yout Yggdrasil server.

You can use pre-made auth points : AuthPoints.MOJANG_AUTH_POINTS or AuthPoints.OPENAUTH_AUTH_POINTS You can alose user the official mojang server : Authenticator.MOJANG_AUTH_URL

Send a request !

Authenticate

Receive an access token by authenticating an user

AuthResponse response = authenticator.authenticate(authagent, "username", "password", "clientToken");

So, replace auth agent with your auth agent (Minecraft, Scrolls, or other) pre-made agent are AuthAgent.MINECRAFT and AuthAgent.SCROLLS. Auth Agent are used to get the profile of the account of your server, every accounts have some profiles, one profile is one game, so to create yout auth agent object, use :

AuthAgent myAgent = new AuthAgent("name", version);

You can manage the profiles in the server ^^ The Auth agent is optional, if you don't send it, response.getSelectedProfile() and response.getAvailableProfiles() will be null.

Replace username with the username of the user account, and password with the password of the user account you wanna auth !

The client token is like a key to protect the access token if you wan't, it is optional !

Every profiles has a username and an ID, user (profile).getName() and (profile).getId() to get them !

Refresh

Receive a new access token by re-authenticating an user with the saved access token of the previous authentication

RefreshResponse response = authenticator.refresh("accessToken", "clientToken");

Replace accessToken by the saved access token from the previous authentication of the user you wanna re-auth, and clientToken by the client token given when authenticating (optinal if you didn't give it)

The reponse is near the same as the auth response (selectedProfile, accessToken, etc...)

Validate

This is to check an access token, WARNING : This method should not be used by the client. Juste do

authenticator.validate("accessToken");

Signout

Invalidate an access token using the username and the password of the user that had the access token

authenticator.signout("username", "password");

Invalidate

Invalidate an access token using the access token and its client token

authenticator.invalidate("accessToken", "clientToken");

openauth's People

Contributors

06games avatar 3arthqu4ke avatar alwyn974 avatar dxssucuk avatar flowarg avatar jachou-yt avatar litarvan avatar thekodetoad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openauth's Issues

[DOC] Request for full documentation of all classes.

Is your documentation request related to a problem? Please describe.
N/A

List the wanted documentations on the classes
Documentation is request on all classes which also for example contains the entity class to store information,

Additional reasoning
The code would be easier to maintain.

[BUG] Microsoft Web Page looping on sending a code to Authentificator App

Describe the bug
When logging in with the Authentificator App, microsoft wants to send a code again infinitly

To Reproduce
Steps to reproduce the behavior:

  1. Make a simple Microsoft implementation
  2. Try to login with an account that uses Microsoft Auth App
  3. It wants to send a code again

Expected behavior
That it will let me login

Screenshots
image

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

  • OS: Windows 11 22H2 Build: 22621.1555
  • Java version: Temurin-17.0.4.1+1 (build 17.0.4.1+1)
  • Version: 1.1.3
  • JavaFx: 20, modules: 'javafx.controls', 'javafx.web', 'javafx.swing'
    Additional context

MicrosoftAuthenticator login functions doesn't seem to actually log in the player

Describe the bug
When running any login method in MicrosoftAuthenticator, the client doesn't seem to log in. I verified this by running the loginWithCredentials method with my own credentials, but no exception was thrown. When logging into singleplayer, I was still on the default Fabric profile of "Player###" and multiplayer yielded "Invalid Session".

To Reproduce
Steps to reproduce the behavior:

  1. In FabricMC, set up OpenAuth in Gradle normally.
  2. In the startup code, I put
MicrosoftAuthenticator auth = new MicrosoftAuthenticator();
try {
    MicrosoftAuthResult res = authenticator.loginWithCredentials("[email redacted]", password);
    MinecraftProfile prof = res.getProfile();
    System.out.println("Logged in as " + prof.getName() + " (" + prof.getId() + ")");
} catch (MicrosoftAuthenticationException e) {
    e.printStackTrace();
}
  1. I started FabricMC
  2. I saw "Logged in as ...", but in singleplayer, I got the default FabricMC username, and when I tried joining a server, I got "Invalid Session".

Expected behavior
I expected OpenAuth to actually set the session.

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

  • OS: Windows
  • Java version 17.0.9-termium
  • Version: Latest (1.6.1?)

Additional context
I found a solution to this problem by manually setting a session. In my alt manager class, I created the function login(), which logs in the player.

public static Session session;
public static void login() {
        File secret = new File(".secret");
        String password;
        try {
            password = Files.readString(secret.toPath());
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
        try {
            MicrosoftAuthResult res = authenticator.loginWithCredentials("[email redacted]", password);
            MinecraftProfile prof = res.getProfile();

            session = new Session(
                    prof.getName(),
                    getFormattedUUID(prof.getId()),
                    res.getAccessToken(),
                    Optional.empty(),
                    Optional.empty(),
                    Session.AccountType.MSA
            );
            System.out.println("Logged in as " + prof.getName() + " (" + prof.getId() + ")");
        } catch (MicrosoftAuthenticationException e) {
            throw new RuntimeException(e);
        }
    }

Then, I created a mixin:

@Mixin(MinecraftClient.class)
public class MinecraftClientMixin {
    @Inject(at = @At("HEAD"), method = "getSession()Lnet/minecraft/client/session/Session;", cancellable = true)
    public void getSession(CallbackInfoReturnable<Session> cir) {
        if (AltManager.session != null)
            cir.setReturnValue(AltManager.session);
    }
}

This solved my problem, except the skins don't load. This is probably due to the missing clientId and xuid fields that I set to Optional.empty() in this code. I'm not sure yet, but I think OpenAuth has these fields in the code. I hope that this could be implemented in the future.

Ajout de la gestion des compte microsoft avec le game pass

Bonjour,

Je crois que OpenAuth ne gère pas ceux qui ont minecraft avec le game pass de microsoft.

Est-il possible d'ajouter cette fonctionnalité à OpenAuth car beaucoup de gens ont minecraft avec ceci maintenant !

Bonne journée !

OPENAUTH_AUTH_POINTS

Hey Litarvan.
Je suis en train de faire mon serveur d'authentification avec openauth et openauth-server.
mais j'ai un problème côté client, je peux pas définir AuthPoints. OPENAUTH_AUTH_POINTS, il n'est pas reconnu.

Quand je met NORMAL_AUTH_POINTS :
capture

Merci ;)

PS: Pour l'inscription je demande que le Mdp et le pseudo ? car dans la bdd il y ait plein d'autres colonnes dont je ne comprends pas trop l'existence

Le userId est manquant dans l'AuthProfile

Bonjour,

Tout d'abord, merci pour ton travail qui - après plusieurs années - reste toujours propre et fonctionnel !

J'ai remarqué - lorsque j'ai implémenté le NoLogin sur un launcher - que le champ userId était manquant dans l'AuthProfile.

Dans la réponse Json donnée par Mojang, le selectedProfile ou un availableProfile est comme tel :

"selectedProfile": {
    "agent": string,
    "id": UUID string,
    "name": string,     
    "userId": UUID string,
    "createdAt": number,
    "legacyProfile": boolean,
    "suspended": boolean,
    "paid": boolean,
    "migrated": boolean
}

Les champs id et name sont bien pris du Json, mais il manque userId. Ce champ-là est utile si on souhaite implémenter le NoLogin en complément avec ta lib.

Serait-il possible de l'ajouter au profit de tous ? :)

MS loginWithAsyncWebview Ne fonctionne pas

Hello, lorsque l'on essaye de se connecter au compte Microsoft en utilisant loginWithAsyncWebview, la fenêtre de connection s'affiche mais le contenu de la fenêtre est vide (écran blanc).

Petites infos:

  • JDK 17
  • OpenAuth 1.1.4

Code:
MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
authenticator.loginWithAsyncWebview();

Capture d’écran 2022-11-24 202817

[BUG] Error from loginWithAsyncWebview.

Bug

loginWithAsyncWebview return an error
I think that the problem comes from my Java version but I can't do otherwise.

Config

  • OS: macOS Catalina 10.15.7
  • Java version: Amazon corretto 1.8.0_312

Full error

Exception in thread "JavaFX Application Thread" java.lang.UnsatisfiedLinkError: Can't load library: /Users/$USER/Library/Java/JavaVirtualMachines/corretto-1.8.0_312/Contents/Home/jre/lib/libjfxwebkit.dylib
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1820)
	at java.lang.Runtime.load0(Runtime.java:810)
	at java.lang.System.load(System.java:1088)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
	at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
	at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
	at com.sun.webkit.WebPage.lambda$static$0(WebPage.java:133)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.webkit.WebPage.<clinit>(WebPage.java:132)
	at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
	at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
	at javafx.scene.web.WebView.<init>(WebView.java:273)
	at fr.litarvan.openauth.microsoft.LoginFrame.init(LoginFrame.java:76)
	at fr.litarvan.openauth.microsoft.LoginFrame.lambda$start$0(LoginFrame.java:66)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

Source code

private void authenticateMS() {

        MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
        authenticator.loginWithAsyncWebview().whenComplete((response, error) -> {

            if (error != null) {
                logger.err(error.getMessage());
                return;
            }

            saver.set("msAccessToken", response.getAccessToken());
            saver.set("msRefreshToken", response.getRefreshToken());
            saver.save();

            ModMCore.getInstance().setAuthInfos(new AuthInfos(response.getProfile().getName(), response.getAccessToken(), response.getProfile().getId()));
            this.logger.info("Bienvenue " + response.getProfile().getName());

            Platform.runLater(() -> panelManager.showPanel(new App()));
        });
    }

Ask me for more source code

Graphics Device initialization failed for : d3d, sw while using Webview

When using the Webview to connect an error occurs...

Graphics Device initialization failed for :  d3d, sw
Error initializing QuantumRenderer: no suitable pipeline found
java.lang.RuntimeException: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer.getInstance(QuantumRenderer.java:280)
	at com.sun.javafx.tk.quantum.QuantumToolkit.init(QuantumToolkit.java:243)
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:250)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:250)
	at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:265)
	at fr.litarvan.openauth.microsoft.LoginFrame.<init>(LoginFrame.java:52)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithAsyncWebview(MicrosoftAuthenticator.java:156)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithWebview(MicrosoftAuthenticator.java:142)
	at com.valbion.nennim.launcher.Launcher.authMicrosoft(Launcher.java:48)
	at com.valbion.nennim.launcher.LauncherPanel$2.run(LauncherPanel.java:159)
Caused by: java.lang.RuntimeException: Error initializing QuantumRenderer: no suitable pipeline found
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:94)
	at com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
	at java.base/java.lang.Thread.run(Thread.java:832)
Exception in thread "Thread-0" java.lang.RuntimeException: No toolkit found
	at com.sun.javafx.tk.Toolkit.getToolkit(Toolkit.java:262)
	at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:209)
	at javafx.embed.swing.JFXPanel.initFx(JFXPanel.java:250)
	at javafx.embed.swing.JFXPanel.<init>(JFXPanel.java:265)
	at fr.litarvan.openauth.microsoft.LoginFrame.<init>(LoginFrame.java:52)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithAsyncWebview(MicrosoftAuthenticator.java:156)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithWebview(MicrosoftAuthenticator.java:142)
	at com.valbion.nennim.launcher.Launcher.authMicrosoft(Launcher.java:48)
	at com.valbion.nennim.launcher.LauncherPanel$2.run(LauncherPanel.java:159)

Also, what information should be returned to AuthInfos?

And errors with MicrosoftAuthenticationException return null
Here my code :
JOptionPane.showMessageDialog(LauncherPanel.this, "Erreur, impossible de se connecter : " + e.getCause(), "Erreur - Compte Microsoft", JOptionPane.ERROR_MESSAGE);

tutorial or something

Hello, I'm having a hard time getting this to workand was hoping someone could produce a tutorial for me:)
I'd really appreciate it.
-soft/GamingReflex

[BUG] java.net.UnknownHostException: login.live.com

Description
Every few launches, I get an UnknownHostException and the following stacktrace:

Exception in thread "main" java.lang.RuntimeException: java.net.UnknownHostException: login.live.com
	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:147)
	at fr.litarvan.openauth.microsoft.HttpClient.getText(HttpClient.java:52)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.preAuthRequest(MicrosoftAuthenticator.java:235)
	at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithCredentials(MicrosoftAuthenticator.java:105)
	at Start.main(Start.java:24)
Caused by: java.net.UnknownHostException: login.live.com
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1952)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1947)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1946)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1516)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:114)
	... 4 more
Caused by: java.net.UnknownHostException: login.live.com
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:607)
	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:293)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:463)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:558)
	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:203)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1207)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1056)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:189)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1572)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500)
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3063)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:305)
	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:105)
	... 4 more

Expected behavior
It should work

My code

MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
MicrosoftAuthResult result = null;
   
String username = "DevUser";
String accessToken = " ";
String uuid = "0";
   
   
try {
	result = authenticator.loginWithCredentials(..., ...);
	
	username = result.getProfile().getName();
	accessToken = result.getAccessToken();
	uuid = result.getProfile().getId();
} catch (MicrosoftAuthenticationException e) {
	e.printStackTrace();
}

System.out.printf("Logged in as '%s'\n", username);

Screenshots
image

[Q&A] HTTP 401 when logging in with credentials

Is your question related to a problem?
Then please comment on the already open bug report, if there is no bug report yet you can open one.
Yes, but I'm not sure if it's a bug.
Ask you question!
A clear and concise description of what you want to ask.
How do I fix Minecraft crashing due to a 401 error code on this URL: https://xsts.auth.xboxlive.com/xsts/authorize?
I logged in with credentials, not webview.
Additional context
Add any other context or screenshots about the question here.
image
image

Fix pour l'erreur d'utf-8 avec les accents àéèêô etc

Hello Litarvan x)
Il faut modifier ça

private String sendPostRequest(String url, String json) throws AuthenticationException, IOException {
URL serverURL = new URL(url);
HttpURLConnection connection = (HttpURLConnection) serverURL.openConnection();
connection.setRequestMethod("POST");
// Sending post request
connection.setDoOutput(true);
connection.addRequestProperty("Content-Type", "application/json;charset=utf-8");
DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
wr.writeBytes(json);
wr.flush();
wr.close();

par ça

private String sendPostRequest(String url, String json) throws AuthenticationException, IOException {
    	byte[] jsonBytes = json.getBytes("UTF-8");
        URL serverURL = new URL(url);
        HttpsURLConnection connection = (HttpsURLConnection) serverURL.openConnection();
        connection.setRequestMethod("POST");

        // Sending post request
        connection.setDoOutput(true);
        connection.setRequestProperty("Accept-Charset", "UTF-8");
        connection.setRequestProperty("Content-Type", "application/json");
        connection.setRequestProperty("Content-Length", String.valueOf(jsonBytes.length));
        DataOutputStream wr = new DataOutputStream(connection.getOutputStream());
        wr.write(jsonBytes, 0, jsonBytes.length);
        wr.flush();
        wr.close();

Voilà si t'as le temps d'update et mettre en release pour les autres ^^'

Compatible avec Compte Microsoft

Bonjour !

Possible compatibilité avec les nouveaux Compte Microsoft ?
Je pense pas que cela soit le cas mais une mise à jour pour ceci de prévu ?

Merci d'avance

Bonne journée

[BUG] Webview does not open again, once closed

Describe the bug
Whenever I run MicrosoftAuthResult microsoftAuthResult = microsoftAuthenticator.loginWithWebview(); for the first time, the webview opens. But when I close the webview window and rerun that code, it does not open again (unless I restart the Java process entirely)

To Reproduce
Steps to reproduce the behavior:

  1. Run 'MicrosoftAuthResult microsoftAuthResult = microsoftAuthenticator.loginWithWebview();'
  2. Close the webview window once it appears
  3. Rerun the code 'MicrosoftAuthResult microsoftAuthResult = microsoftAuthenticator.loginWithWebview();'
  4. You can see how it doesn't appear now

Expected behavior
The webview appears as expected.

Desktop

  • OS: Windows 11
  • Oracle Java 20.0.2
  • OpenAuth Version: 1.1.6

Additional context
The line also hangs the java process or thread

[BUG] Short description.

Describe the bug
A clear and concise description of what the bug is.

SRC

            new Thread() {

                @Override
                public void run() {
                    final MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
                    try {
                        MicrosoftAuthResult result = new MicrosoftAuthenticator().loginWithWebview();
                    } catch (MicrosoftAuthenticationException e) {
                    }
                }
            }.start();

Error

[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.NoClassDefFoundError: fr/litarvan/openauth/microsoft/LoginFrame
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithAsyncWebview(MicrosoftAuthenticator.java:150)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithWebview(MicrosoftAuthenticator.java:137)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1052]: at net.testclient.ui.client.altmanager.menus.GuiLoginIntoAccount$1.run(GuiLoginIntoAccount.java:146)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.ClassNotFoundException: fr.litarvan.openauth.microsoft.LoginFrame
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1061]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[02:05:43] [Thread-18/INFO]: [java.lang.ThreadGroup:uncaughtException:1061]: ... 3 more
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: Caused by: java.lang.IllegalArgumentException
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.(ClassReader.java:170)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.(ClassReader.java:153)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.findAndMergeSuperMaps(FMLDeobfuscatingRemapper.java:373)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.getMethodMap(FMLDeobfuscatingRemapper.java:350)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraftforge.fml.common.asm.transformers.deobf.FMLDeobfuscatingRemapper.mapMethodName(FMLDeobfuscatingRemapper.java:312)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.commons.RemappingMethodAdapter.doVisitMethodInsn(RemappingMethodAdapter.java:154)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.commons.RemappingMethodAdapter.visitMethodInsn(RemappingMethodAdapter.java:141)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.readCode(ClassReader.java:1416)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.readMethod(ClassReader.java:1017)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.accept(ClassReader.java:693)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at org.objectweb.asm.ClassReader.accept(ClassReader.java:506)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer.transform(DeobfuscationTransformer.java:44)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
[02:05:43] [Thread-18/INFO]: [java.lang.Throwable:printStackTrace:643]: ... 5 more
Exception in thread "Thread-18" [02:07:42] [Client thread/FATAL]: Reported exception thrown!

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

  • Version: Maven 1.1.4
  • Operating System: Windows 10 (amd64) version 10.0
  • Java Version: 1.8.0_202, Oracle Corporation
  • Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation

Problème avec le crack

Bonjour oui encore moi :/, j'ai un petit soucis j'ai réussis à mettre le launcher en crack mais mon speudo n'est pas le même que celui entré dans le launcher, le speudo est " Sry "

Voici mon code Launcher.java

package fr.cubedev.atlaris;

import java.io.File;
import java.io.IOException;
import java.util.UUID;

import fr.litarvan.openauth.AuthPoints;
import fr.litarvan.openauth.AuthenticationException;
import fr.litarvan.openauth.Authenticator;
import fr.litarvan.openauth.model.AuthAgent;
import fr.litarvan.openauth.model.response.AuthResponse;
import fr.theshark34.openlauncherlib.LaunchException;
import fr.theshark34.openlauncherlib.external.ExternalLaunchProfile;
import fr.theshark34.openlauncherlib.external.ExternalLauncher;
import fr.theshark34.openlauncherlib.minecraft.AuthInfos;
import fr.theshark34.openlauncherlib.minecraft.GameFolder;
import fr.theshark34.openlauncherlib.minecraft.GameInfos;
import fr.theshark34.openlauncherlib.minecraft.GameTweak;
import fr.theshark34.openlauncherlib.minecraft.GameType;
import fr.theshark34.openlauncherlib.minecraft.GameVersion;
import fr.theshark34.openlauncherlib.minecraft.MinecraftLauncher;
import fr.theshark34.openlauncherlib.util.ProcessLogManager;
import fr.theshark34.supdate.BarAPI;
import fr.theshark34.supdate.SUpdate;
import fr.theshark34.supdate.application.integrated.FileDeleter;
import fr.theshark34.swinger.Swinger;

public class Launcher {

public static final GameVersion ATARIS_VERSION = new GameVersion("1.8", GameType.V1_8_HIGHER);
public static final GameInfos ATARIS_INFOS = new GameInfos("Ataris", ATARIS_VERSION, new GameTweak[]{});
public static final File ATARIS_DIR = ATARIS_INFOS.getGameDir();
public static final File ATARIS_CRASH_FOLDER = new File(ATARIS_DIR, "crashes");

private static AuthInfos authInfos = new AuthInfos("PlayerUsername", "token", "uuid");
private static Thread updateThread;

public static void auth(String username, String password) throws AuthenticationException {
	
	authInfos = new AuthInfos(username, "sry", "nope");
        
}

public static void update() throws Exception {
	SUpdate su = new SUpdate("http://launcher.onexius.com/", ATARIS_DIR);
	su.addApplication(new FileDeleter());
	
	 updateThread = new Thread() {			
	private int val;
	private int max;
	    
	@Override
	public void run() {
	 while(!this.isInterrupted()) {
		if(BarAPI.getNumberOfFileToDownload() == 0 ) {
			LauncherFrame.getInstance().getLauncherPanel().setInfoText("Vérification des fichiers");
				continue;
			}
	val = (int) (BarAPI.getNumberOfTotalDownloadedBytes() / 1000);
	max = (int) (BarAPI.getNumberOfTotalBytesToDownload() / 1000);
			 
	LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setMaximum(max);
	LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setValue(val);
			 
	LauncherFrame.getInstance().getLauncherPanel().setInfoText("Telechargement en cours " + 
				 BarAPI.getNumberOfDownloadedFiles() + "/" + BarAPI.getNumberOfFileToDownload() + " " +
			 		Swinger.percentage(val, max) + "%");
		   }
	   }
	};
	updateThread.start();
	
	su.start();
	updateThread.interrupt();
}
public static void launch() throws IOException, LaunchException {
  try
     {
	 AuthInfos authInfos = new AuthInfos("sry", "nope", UUID.randomUUID().toString()); 
	 ExternalLaunchProfile profile = MinecraftLauncher.createExternalProfile(Launcher.ATARIS_INFOS, GameFolder.BASIC, authInfos);
     ExternalLauncher launcher = new ExternalLauncher(profile);
      
     Process p = launcher.launch(); 
     ProcessLogManager manager = new ProcessLogManager(p.getInputStream(), new File(ATARIS_DIR, "logs.txt"));
     manager.start();	
     
    Thread.sleep(5000L);
    LauncherFrame.getInstance().setVisible(false);
    p.waitFor();
     }
     catch (InterruptedException e)
     {
    	 e.printStackTrace();
     }
      System.exit(0);
	}

public static void interruptThread() {
	{	
		updateThread.interrupt();
	}
}

}

Problème de token

Bonjour quand je lance le launcher, je me login et le launcher fait ses màj et au moment de lancer le jeu, il ne lance pas et fait ceci : [OpenLauncherLib] Lancement de net.minecraft.client.main.Main
joptsimple.MissingRequiredOptionException: Missing required option(s) ['accessToken']
Exception in thread "main" at joptsimple.OptionParser.ensureRequiredOptions(OptionParser.java:375)
at joptsimple.OptionParser.parse(OptionParser.java:365)
at net.minecraft.client.main.Main.main(SourceFile:51)

https://pastebin.com/SkvtEzaS

Une solution ? merci

Impossible de se connecter

Bonjour j'ai installé openauth-server et j'aimerai que quand on s'inscrit sur mon site cela soit ces identifiants que l'on utilise pour se connecter a mon launcher cependant quand je rentre mes identifiants cela est incorrect j'ai vérifier sur ma base de donnée la table openauth_user s'est crée mais elle est vide faut-t'il modifer des informations dans les fichier du openauth_server ? Voici mon code java si cela peut aider : AuthPoints points = new AuthPoints("http://www.k2ocraft.fr/server/app/authenticate.php",
"http://www.k2ocraft.fr/server/app/refresh.php",
"http://www.k2ocraft.fr/server/app/validate.php",
"http://www.k2ocraft.fr/server/app/logout.php",
"http://www.k2ocraft.fr/server/app/invalidate.php");
Authenticator authenticator = new Authenticator("http://www.k2ocraft.fr/server/", AuthPoints.NORMAL_AUTH_POINTS);

On peut voir que je n utilise pas la variable que j ai crée sinon j ai un autre message d erreur qui apparaît .
Merci de votre réponse

[BUG] Server returned HTTP response code: 429 for URL: https://api.minecraftservices.com/authentication/login_with_xbox

when i am executing the code iI have this error

Caused by: java.io.IOException: Server returned HTTP response code: 429 for URL: https://api.minecraftservices.com/authentication/login_with_xbox
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1952)
	at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1947)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1946)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1516)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1500)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
	at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:114)
	... 6 more

My code

MicrosoftAuthenticator authenticator = new MicrosoftAuthenticator();
MicrosoftAuthResult result = null;
try {
	result = authenticator.loginWithCredentials(email,password);
	System.out.printf("Logged in with '%s'%n", result.getProfile().getName());
	Minecraft.getMinecraft().session = new Session(result.getProfile().getName(),result.getProfile().getId(), result.getAccessToken(),"legacy");
} catch (MicrosoftAuthenticationException e) {
	this.status = "&4Login failed.";
}

Probleme lors du lancement Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor

Bonjour jetais entrais de coder mon launcher personnel et j'ai eu cette
erreur impossible de lancer le jeu voice le probleme
[18:12:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:12:49] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker
[18:12:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:12:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker
[18:12:49] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.Class.getDeclaredConstructors0(Native Method)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.Class.getConstructor0(Class.java:3075)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.Class.newInstance(Class.java:412)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at net.minecraft.launchwrapper.LaunchClassLoader.registerTransformer(LaunchClassLoader.java:88)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper.injectIntoClassLoader(CoreModManager.java:108)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:115)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: Caused by: java.lang.ClassNotFoundException: org.objectweb.asm.ClassVisitor
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:117)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
[18:12:49] [main/INFO] [STDERR]: [java.lang.Throwable$WrappedPrintStream:println:749]: ... 8 more

et voila le code `package com.madjido.fr.launcher;

import java.io.File;
import java.io.IOException;

import fr.theshark34.openauth.AuthPoints;
import fr.theshark34.openauth.AuthenticationException;
import fr.theshark34.openauth.Authenticator;
import fr.theshark34.openauth.model.AuthAgent;
import fr.theshark34.openauth.model.response.AuthResponse;
import fr.theshark34.openlauncherlib.launcher.AuthInfos;
import fr.theshark34.openlauncherlib.launcher.GameFolder;
import fr.theshark34.openlauncherlib.launcher.GameInfos;
import fr.theshark34.openlauncherlib.launcher.GameLauncher;
import fr.theshark34.openlauncherlib.launcher.GameTweak;
import fr.theshark34.openlauncherlib.launcher.GameType;
import fr.theshark34.openlauncherlib.launcher.GameVersion;
import fr.theshark34.supdate.BarAPI;
import fr.theshark34.supdate.SUpdate;
import fr.theshark34.supdate.application.integrated.FileDeleter;
import fr.theshark34.swinger.Swinger;
public class Launcher {

public static final GameVersion SC_VERSION = new GameVersion("1.7.10", GameType.V1_7_10);
public static final GameInfos SC_INFOS = new GameInfos("Lunaria", SC_VERSION ,true ,new GameTweak[] {GameTweak.FORGE});
public static final File SC_DIR = SC_INFOS.getGameDir();

private static AuthInfos authInfos;
private static Thread updateThread;

public static void auth(String username, String password) throws AuthenticationException{
	Authenticator authentificator = new Authenticator(Authenticator.MOJANG_AUTH_URL, AuthPoints.NORMAL_AUTH_POINTS);
	AuthResponse response = authentificator.authenticate(AuthAgent.MINECRAFT, username, password, "");
	authInfos = new AuthInfos(response.getSelectedProfile().getName(), response.getAccessToken(), response.getSelectedProfile().getId());
}

public static void update() throws Exception {
	SUpdate su = new SUpdate("https://launcherpanel.000webhostapp.com/", SC_DIR);
	su.addApplication(new FileDeleter());
	
	updateThread = new Thread() {
		private int val;
		private int max;
		@Override
		public void run() {
			while(!this.isInterrupted()) {
				if(BarAPI.getNumberOfFileToDownload() == 0){
					LauncherFrame.getInstance().getLauncherPanel().setInfoText("Verification des fichers...");
					continue;
				}
				val = (int) (BarAPI.getNumberOfTotalDownloadedBytes() / 1000);
				max = (int) (BarAPI.getNumberOfTotalBytesToDownload() / 1000);
				
				
				
				LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setMaximum(max);
                LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setValue(val);
                
                LauncherFrame.getInstance().getLauncherPanel().setInfoText("Telechargement des fichiers... " 
                + BarAPI.getNumberOfDownloadedFiles() + "/" + BarAPI.getNumberOfFileToDownload() +
                Swinger.percentage(val, max) + "%");
				
			}
		}
	};
	updateThread.start();
	
	su.start();
	
	updateThread.interrupt();
}

public static void launch() throws IOException {
	GameLauncher gameLauncher = new GameLauncher(SC_INFOS,GameFolder.BASIC,authInfos);
	Process p = gameLauncher.launch();
	try {
		Thread.sleep(5000L);
	} catch (InterruptedException e) {
		
	}
	LauncherFrame.getInstance().setVisible(false);
	try {
		p.waitFor();;
	} catch (InterruptedException e) {
		
	}
	System.exit(0);
}

public static void interruptThread() {
	updateThread.interrupt();
}

}
`
Merci de repondre.

java.io.FileNotFoundException:https://api.minecraftservices.com/minecraft/profile

java.lang.RuntimeException: java.io.FileNotFoundException: https://api.minecraftservices.com/minecraft/profile
at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:147)
at fr.litarvan.openauth.microsoft.HttpClient.readJson(HttpClient.java:100)
at fr.litarvan.openauth.microsoft.HttpClient.getJson(HttpClient.java:61)
at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithTokens(MicrosoftAuthenticator.java:225)
at fr.litarvan.openauth.microsoft.MicrosoftAuthenticator.loginWithCredentials(MicrosoftAuthenticator.java:115)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:574)
at net.minecraft.client.Minecraft.run(Minecraft.java:408)
at net.minecraft.client.main.Main.main(Main.java:113)
at Start.main(Start.java:22)
Caused by: java.io.FileNotFoundException: https://api.minecraftservices.com/minecraft/profile
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1964)
at sun.net.www.protocol.http.HttpURLConnection$10.run(HttpURLConnection.java:1959)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1958)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1528)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1512)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:114)
... 9 more
Caused by: java.io.FileNotFoundException: https://api.minecraftservices.com/minecraft/profile
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1910)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1512)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:3095)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:305)
at fr.litarvan.openauth.microsoft.HttpClient.readResponse(HttpClient.java:105)
... 9 more

[FEATURE] Clear cache function

Is your feature request related to a problem? Please describe.
Depends, users wants to sign in twice but can't because the Microsoft auth keeps them logged in, with no obvious way of logging out.

Describe the solution you'd like
A method to logout the active user (or clear the entire cache and everything with it) within MicrosoftAuthenticator.

Maven repository

Bonjour,

Je me demandais s'il existait un maven repository pour le projet, car il n'y a aucune mention de celui-ci ?
Et s'il n'existait pas, s'il serait possible de l'ajouter ?

Je vous remercie d'avance pour la réponse.

[Q&A]

Hello, I am trying to use openauth v 1.1.6, to make an auth on my client, but the problem is I am getting the following error / bug?
image

I don't know how to fix it I have tried almost everything, but I have ran out of ideas.

[BUG] IOException -> File not found

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.

[FEATURE] Rollback/correct some #18 things related to javafx

The #18 and #22 PRs introduce new features, improvements, deprecation-marks, and I'm glad to hear that this lib receives some new contributions.
But the Added openJFX as dependency so users are not forced into downloading the JFX JDK. thing is a mess and has to be removed as soon as possible. Why? Because it automatically ADDS NEW DEPENDENCIES to the user project that isn't useful for the most of people.
Because there are many people who are still in Java 8 or with some others Java versions like 18 or 17 (Because Java 11 isn't very useful ATM) or they just don't use at all JavaFx. It's a really bad idea to add these dependencies that are useful ONLY if the user needs JavaFx and uses a Java 11 distribution without JavaFx.

Furthermore, we receive this week a lot of help requests because this update broke a lot of launcher because JavaFX clashes. Yay...
Now, we have to include the library and exclude ALL JavaFx dependencies... Pretty cool

implementation ('fr.litarvan:openauth:1.1.3') {
    exclude module: 'javafx-media'
    exclude module: 'javafx-controls'
    exclude module: 'javafx-swing'
    exclude module: 'javafx-base'
    exclude module: 'javafx-graphics'
    exclude module: 'javafx-web'
}

I think an authentication library doesn't have to include graphics dependencies that also takes a lot of space on the disk.

NOTE:
I saw also a CI that maybe need JavaFx to functions.

  1. Is the CI useful for this lib? Does this lib contains some unit tests ?
  2. Can the CI setups itself a valid jdk with JavaFx ?

Thanks you for reading

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.