tycrek / MCAuthLib

A Minecraft authentication library for MCProtocolLib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MCAuthLib (tycrek edition)

Image

A Minecraft authentication library for MCProtocolLib


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.

tycrek edition

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.

Login methods

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.

Example code

See example/com/github/steveice10/mc/auth/test/MinecraftAuthTest.java for example usage.

Installing as a dependency

The recommended way of installing MCAuthLib is through JitPack. For more details, see MCAuthLib on JitPack.

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}
dependencies {
    implementation 'com.github.tycrek:MCAuthLib:3.0'
}

Support and development

Please join the GeyserMC Discord server and visit the #mcprotocollib channel for discussion and support for this project.

License

MCAuthLib is licensed under the MIT license.

About

A Minecraft authentication library for MCProtocolLib

License:MIT License


Languages

Language:Java 100.0%