GithubHelp home page GithubHelp logo

mrletsplay2003 / shittyauthlauncher Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 2.0 8.39 MB

A Minecraft launcher for using a custom (shitty) authentication server

Java 98.24% CSS 1.76%
minecraft mojang yggdrasil minecraft-authentication minecraft-launcher

shittyauthlauncher's Introduction

ShittyAuthLauncher

A Minecraft launcher that uses a shitty authentication server

For the authentication server, go here

ShittyAuthLauncher is a Minecraft launcher that's not tied to any specific authentication server. It lets you fully configure which auth/session/api server you want to use, and will automatically patch the Mojang-provided authlib to use the configured auth server.

Installing

Just download the latest stable launcher JAR file from the releases section. You can then run it using any Java 11+ VM on Linux or Windows. Running the launcher on MacOS should also work, but I can't really test that.

You can also download the latest development version of the launcher from here

Features

  • Automatically patches Mojang's authlib as well as the Minecraft JAR
  • Configurable auth/session/api/services servers
  • Supports custom skin hosts
  • Supports authentication and skins in modern versions of Minecraft as well as older ones (as low as beta 1.0 when using ShittyAuthServer)
  • Works completely independently of the normal Minecraft launcher
  • Supports having multiple accounts on different auth servers, multiple installations and mirrors and mix-and-matching between them

Compiling the launcher yourself

The launcher uses Maven for building.

To compile the launcher, use:

$ mvn package

which will generate a ShittyAuthLauncher-VERSION.jar in the target folder

shittyauthlauncher's People

Contributors

ajh123 avatar mrletsplay2003 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

shittyauthlauncher's Issues

About the certificate error in #5

From #5:

Are you using a self-signed certificate which your OS doesn't trust? Maybe you've added an exception in other places

Actually, it's a Cloudflare origin server certificate. It is liked by web browsers and curl. Maybe Java cannot find Cloudflare's root certificate?
I will do a bit of testing eventually. Maybe I'll also ask Cloudflare about it.

Post data doesn't seem to be received by custom auth servers

My auth server is based of the Mjolnir-Authentication-Server

the authenticate endpoint looks like this

exports.authenticate = authenticate;
function authenticate(request, response) {
    logger.log("Authentication request, user: " + request.body.username);
    console.log("body: %j", request.body); //This is now empty :(

    userManager.authenticate(request.body.username, request.body.password, request.body.clientToken)
        .then(function (data) {
            logger.log("  Success, with hash "+data.hash);
            var jsonResponse = {
                "user": {
                    "username": request.body.username,
                    "properties": []
                },
                "accessToken": data.accessToken,
                "clientToken": data.clientToken
            };
            if (request.body.agent) {
                jsonResponse.selectedProfile = {
                    "id": data.userId,
                    "name": data.playerName
                };
                jsonResponse.availableProfiles = [
                    {
                        "id": data.userId,
                        "name": data.playerName
                    }
                ];
            }

            console.log(jsonResponse)
            response.json(jsonResponse);
        })
        .catch(function () {
            logger.log("  Bad credentials");
            response.json({
                "error": "ForbiddenOperationException",
                "errorMessage": "Invalid credentials. Invalid username or password."
            });
        });
}

When this line


was

post.setContent(req.toString().getBytes(StandardCharsets.UTF_8));

and weren't deprecated, the post data was successfully received.

Certificate errors

so now i got a whole new problem, when i try to add an account with ssl, i get certificate errors.
i also found the already closed problem, but i didnt really catch up what the solution was there, despite that i have the same problem.
error only appears on client side.
correct me if this is just about false configuration in the backend, but im assuming after googeling it has to be fixed programatically.
tryed java11 and java17, also jdk19-jre, same result.

How to reproduce:

  1. create an shittyauthserver instance, using a domain create an ssl cert using letencrypt.
  2. open shittyauthlauncher, add an account and configure the right server adress.
  3. try to log into an account, start minecraft or get the certificate of the server - error

Logs:

me.mrletsplay.mrcore.http.HttpException: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at me.mrletsplay.mrcore.http.HttpGeneric.execute(HttpGeneric.java:158)
	at me.mrletsplay.shittyauthlauncher.auth.AuthHelper.authenticate(AuthHelper.java:34)
	at me.mrletsplay.shittyauthlauncher.ShittyAuthController.showLoginDialog(ShittyAuthController.java:559)
	at me.mrletsplay.shittyauthlauncher.ShittyAuthController.lambda$createAccountItem$15(ShittyAuthController.java:467)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Node.fireEvent(Node.java:8797)
	at javafx.scene.control.Button.fire(Button.java:203)
	at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:208)
	at com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
	at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:247)
	at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
	at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
	at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
	at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
	at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
	at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
	at javafx.event.Event.fireEvent(Event.java:198)
	at javafx.scene.Scene$MouseHandler.process(Scene.java:3881)
	at javafx.scene.Scene.processMouseEvent(Scene.java:1874)
	at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2607)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:411)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:301)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:450)
	at com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:424)
	at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:449)
	at com.sun.glass.ui.View.handleMouseEvent(View.java:551)
	at com.sun.glass.ui.View.notifyMouse(View.java:937)
	at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
	at com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
	at java.base/java.lang.Thread.run(Thread.java:1589)
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:851)
	at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
	at me.mrletsplay.mrcore.http.HttpGeneric.execute(HttpGeneric.java:156)
	... 60 more
Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:130)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:371)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:309)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1351)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.onConsumeCertificate(CertificateMessage.java:1226)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.consume(CertificateMessage.java:1169)
	at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
	at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
	at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1273)
	at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1260)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
	at java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1205)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate.lambda$executeTasks$3(SSLFlowDelegate.java:1119)
	at java.net.http/jdk.internal.net.http.HttpClientImpl$DelegatingExecutor.execute(HttpClientImpl.java:172)
	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate.executeTasks(SSLFlowDelegate.java:1114)
	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate.doHandshake(SSLFlowDelegate.java:1080)
	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate$Reader.processData(SSLFlowDelegate.java:484)
	at java.net.http/jdk.internal.net.http.common.SSLFlowDelegate$Reader$ReaderDownstreamPusher.run(SSLFlowDelegate.java:268)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$LockingRestartableTask.run(SequentialScheduler.java:205)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$CompleteRestartableTask.run(SequentialScheduler.java:149)
	at java.net.http/jdk.internal.net.http.common.SequentialScheduler$SchedulableTask.run(SequentialScheduler.java:230)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	... 1 more
Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:388)
	at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:271)
	at java.base/sun.security.validator.Validator.validate(Validator.java:256)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:285)
	at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:144)
	at java.base/sun.security.ssl.CertificateMessage$T13CertificateConsumer.checkServerCerts(CertificateMessage.java:1329)
	... 21 more
Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
	at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
	at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
	at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:383)
	... 26 more

Installations

We should have something like the vanilla launcher's installations tab, and a way to import vanilla installations, so we are able to easily run modded clients

[Suggestion] Plugin API?

A plugin API would allow people to possibly rebrand the launcher and add new UI features without people actually having to fork this and change the aspects they want.

This could include

  • Changing Launcher's name, version( even the ones sent to the authentication servers ) and icons. Could be used by mod packs that use custom launchers, to match the branding of the mod packs
  • Changing the Default Mirror, add and delete authentication servers (methods). Good for some servers that use their own launcher and auth servers
  • (Complex) Add new UI features e.g. specialised tabs at the top which could open various JavaFX elements - like a custom side bar or a popup.
  • Adding, deleting and changing themes.
  • Load plugins from a folder or the class path. Loading from class path would allow people to package their plugin in the same jar as the launcher.

I know of a library called PF4J (Plugin Framework for Java). You may see how I use it in my game.

Skins don't work

I tried it out, I hosted the auth server as well but the skin was displayed wrong.

Server patcher

To be able to join servers with our custom accounts, we need to patch servers to. I have found some tools, but they are old and don't work. Maybe add a download server button to the launcher and it will patch the server's authlib to.

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.