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.
My fork of MCAuthLib supports password-less Microsoft logins using OAuth "device code" authentication. This is a more modern method of authenticating users that does not require them to provide their username or password to the developer. This method supports multi-factor secured Microsoft accounts, further improving account security.
Microsoft authentication is handled by Microsoft Authentication Library (MSAL) for Java.
Mojang logins have been removed as of 2022-03-29. Additionally, users are not permitted to authenticate Microsoft accounts using usernames or passwords. Trying to set a username
and password
on a LoginRequest
will throw an exception. This is due to the fact that Microsoft advises against using that authentication method, and it's simply a poor way of authenticating.
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:3.0'
}
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.