MCMSAL

MinecraftMicrosoft Authentication Library for Java 8+, adapted from MiniLauncher code (Java 11).

License

License

GroupId

GroupId

fr.flowarg
ArtifactId

ArtifactId

mcmsal
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

MCMSAL
MinecraftMicrosoft Authentication Library for Java 8+, adapted from MiniLauncher code (Java 11).
Project URL

Project URL

https://github.com/FlowArg/MCMSAL
Source Code Management

Source Code Management

http://github.com/FlowArg/MCMSAL/tree/master

Download mcmsal

Dependencies

compile (2)

Group / Artifact Type Version
com.googlecode.json-simple : json-simple jar 1.1.1
fr.flowarg : flowmultitools jar 1.2.4

Project Modules

There are no modules declared in this project.

version

MCMSAL

MinecraftMicrosoft Authentication Library for Java 8+, adapted from MiniLauncher code (Java 11)

Installation

Gradle

In your block repositories, add this lines :

repositories {
    mavenCentral()
}

and in your dependencies block :

dependencies {
    implementation 'fr.flowarg:mcmsal:VERSION'
}

Maven

<dependencies>
    <dependency>
      <groupId>fr.flowarg</groupId>
      <artifactId>mcmsal</artifactId>
      <version>VERSION</version>
    </dependency>
</dependencies>

Usage

Using JavaFX

There is a class named JFXAuth who can help you to use auth with Microsoft account (using a webview). There is an example :

    // in a class
    private GridPane layout;


    // in a method
    JFXAuth.authenticateWithWebView(new JFXAuthCallback() {

        @Override
        public void beforeAuth(WebView webView)
        {
            MyClass.this.layout.getChildren().add(webView);
        }

        @Override
        public void webViewCanBeClosed(WebView webView)
        {
            MyClass.this.layout.getChildren().remove(webView);
        }

        @Override
        public Consumer<AuthInfo> onAuthFinished()
        {
            return (authInfo) -> {
                System.out.println(authInfo);
                // another actions
            };
        }

        @Override
        public void exceptionCaught(MCMSALException e)
        {
            e.printStackTrace();
        }

        @Override
        public double prefWidth()
        {
            return 405;
        }

        @Override
        public double prefHeight()
        {
            return 405;
        }
})

Using Swing

There is no class who can help you to auth directly with swing. If you've found a solution, please make a pull request. If you have the authCode, you can use directly MicrosoftAuthentication#authenticate(String, Consumer<AuthInfo>) method.

Versions

Version
1.0.0