A Minecraft plugin to help you set up a Minecraft verification process for a third-party application.
When player issues the command /verify on a Minecraft server (1.20.4) an 8-digits code is generated.
The following data (a Ticket) are then inserted into a SQL database :
datetime(DATETIME) : The date the command was issued atuuid(VARCHAR(36)) : The player's UUIDcode(INT) : The 8-digits code
When a user tries to verify on a third-party application (a website for instance) he will be prompted a code. The application may then perform a request to the database to retrieve a Ticket with the given code. If a Ticket is found, the UUID can be used to associate a Minecraft username to the website account.
Note: It is recommended for the third-party application to define an expiration delay for a Ticket (for instance: if the Ticket has been emitted more than 5 minutes ago it will no longer be considered as valid).
This plugin has been made for Minecraft 1.20.4 using PaperMC.
In order for this project to work you'll need :
- Java 17
- SQL Database with a
ticketstable configured as the following :
create table tickets
(
id int auto_increment
primary key,
datetime date not null,
uuid varchar(36) not null,
code int not null
)
engine = InnoDB;- Database user credentials and link in the
src/main/java/ressources/config.yml.
- The
/verifycommand has a default cooldown of 5 minutes - There can't be 2 Tickets with the same code in the database
Warning: Since there is no system for deleting tickets, the database may be filled with 80 millions tickets. In that scenario the plugin will no longer work.
- Auto deleting old ticket after a certain amount of time (10 minutes)
- Log every issued tickets in a separated file
- Regenerate the code if it's already found in the database
- Create a Docker Compose file to handle every service of this project (Minecraft Server, configured SQL database).
