Giter Club home page Giter Club logo

authenticator's Introduction

Authenticator

Description

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 MySQL database :

  • datetime (DATETIME) : The date the command was issued at
  • uuid (VARCHAR(36)) : The player's UUID
  • code (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.

Scheme.png

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).

Requirements

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 tickets table 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.

Behavior

  • The /verify command has a default cooldown of 5 minutes
  • There can't be 2 Tickets with the same code in the database
  • Database entry that are older than 10 minutes are automatically deleted (TODO)
  • All issued tickets are logged in the tickets.txt file (TODO)

TODO

  • 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

authenticator's People

Contributors

therealgabhas avatar

Stargazers

Thomas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.