MCAuthLib is a library for authentication with Minecraft accounts. It is used in projects such as MCProtocolLib to handle authenticating users. Further, projects such as ttRMS use MCProtocolLib for interacting with Minecraft servers & clients.
I use MCAuthLib (and MCProtocolLib) in one of my other projects, ttRMS. I've made some changes to better suit my needs.
The biggest differences between my repo and the GeyserMC repo are:
- Project now uses Gradle instead of Maven
- Target JDK is now Java 16, instead of Java 7
- My repo utilizes Lombok to reduce manual boilerplate
Generally, users of my fork would be looking for a more modern codebase.
See example/com/github/steveice10/mc/auth/test/MinecraftAuthTest.java for example usage.
The recommended way of installing MCAuthLib is through JitPack. For more details, see MCAuthLib on JitPack.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.tycrek:MCAuthLib:__version__'
}
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.tycrek</groupId>
<artifactId>MCAuthLib</artifactId>
<version>__version__</version>
</dependency>
MCAuthLib uses Maven to manage dependencies. To build the source code, run Now uses Gradle, will need to update this section.mvn clean install
in the project root directory.
Visit wiki.vg for documentation on Mojang API authentication and Microsoft's API authentication.
AuthenticationService |
Usage |
---|---|
MojangAuthenticationService |
Used for authenticating Mojang accounts. Supports regular Mojang accounts (email) and legacy accounts (username). |
MsaAuthenticationService |
Used for authenticating Microsoft accounts. Device Code auth uses the Microsoft Authentication Library (MSAL) for Java. Username/password auth uses a custom implementation using a combination of Microsoft, Mojang, and Xbox API's. |
Please join the GeyserMC Discord server and visit the #mcprotocollib channel for discussion and support for this project.
MCAuthLib is licensed under the MIT license.