Welcome to 42AuthCraft, a minecraft plugin to restrict access to 42 Students 🔒 This is a simple and lightweight authentication plugin for Minecraft Spigot servers (version 1.21.X). Designed specifically for the 42 Network students, it allows you to authenticate on a Minecraft server using your 42 intranet credentials via OAuth2.
A minecraft server restricted to 42 students that you can join
ip: play.ruinformatique.ch
- Simple & Lightweight: No sensitive data is stored.
- OAuth2 Authentication: Authenticate using your 42 intranet credentials.
- Session-Based: Players need to re-authenticate each time they join the server.
- Customizable: Replace the default messages with your own.
- Nickname Sync: Automatically set the player's nickname to their 42 username if configured in the
config.yml
.
- Join the Server: When a player joins the server, they are added to the list of unauthenticated players.
- Authenticate: The player must use the
/login
command, which provides a link to authenticate via the 42 intranet. - Play: Once authenticated, the player is removed from the unauthenticated list and can play normally for the current session.
- Re-authentication: Players must re-authenticate each time they join the server. If the server is reloaded, all connected players will need to re-authenticate.
- Get 42 API keys: You will need to create an OAuth2 application on the 42 intranet to get your client ID and client secret here.
- Set up the Redirect URI: Set the redirect URI to your server on the 42 intranet application settings. By default, the redirect URI is
http://localhost:8080/oauth2/callback
, I recommend using a reverse proxy and domain name to redirect to your server. - Download the Plugin: Download the latest release from the github repository.
- Install the Plugin: Place the downloaded
.jar
file in theplugins
folder of your Spigot server. - Start the Server: Start your server and wait for the plugin to load.
- Configure the Plugin: Open the
config.yml
file in the42AuthCraft
folder and set your client ID and client secret. - Reload the Server: Reload the server to apply the changes.
- Play: Join the server and use the
/login
command to authenticate.
- Clone the Repository: Clone the repository to your local machine.
- Set up the 42 API keys: Follow the steps above to get your client ID and client secret.
- Set up the Redirect URI: Set the redirect URI to
http://localhost:8080/oauth2/callback
on the 42 intranet application settings. - Compile with Maven: Run
mvn clean install
to compile the plugin.
This is my first Java project and my first Minecraft plugin, so please be kind! Feel free to contribute by opening issues or submitting pull requests.
This project is licensed under the MIT License. See the LICENSE file for details.
- Special thanks to the Spigot community for their invaluable resources and tutorials.
Happy crafting! 🛠️🎉