Skip to content

A Minecraft authentication library for MCProtocolLib

License

Notifications You must be signed in to change notification settings

tycrek/MCAuthLib

 
 

Repository files navigation

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%