Home›Java›Mods›VaultJwt
VaultJwt
ModsJava

VaultJwt

Java mod listed for Minecraft 1.13–1.16. Downloads from the MC Java Mods app on Android.

⬇ Download on Spigot
VaultJwt

Plugin for Spigot servers that cryptographically signs the role and account UUID a player has, and displays a link with that token in the form of a JSON Web Token.

Useful for when you need to connect forum/IRC/Discord accounts to a Minecraft server account with a secure, self-serve system

Setup

Requires Vault API.

Run:
Code (Text):
openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt ec_param_enc:named_curve -out vaultjwt.key
openssl ec -in jwt.key -pubout -out vaultjwt.key.pub
Paste vaultjwt.key into the privKey section of plugins/VaultJwt/config.yml, replacing the included example key. Do not expose this key publicly, as it allows anyone to identify themselves as anyone to your service.

Give a copy of vaultjwt.key.pub to the third party service verifying a signature (e.g. your discord/irc bot, your website, etc.)

Configure authTokenUrl with the self-serve URL you wish to direct users to when they run /token

Spigot commands & permissions

vaultjwt.token /token - Generate a token for the player running it. It is safe to give this permission to everyone. Only the console can specify an argument, the username to generate a token for.

vaultjwt.bulktoken /bulktoken - Generate a token for everyone who has ever run the command. These tokens do not allow authenticating as users, so it's safe (but pointless) to give this permission to everyone. This is designed for when you wish to update everyone's roles at once.

JSON format

When /token is run, a JWT with the following format is produced
Code (Text):
{
   exp: 1600829926,  // expires in 1 hour
   uuid: "2318e8d5-4b49-44b8-8a68-a7921fdf00a6",
   groups: ["admin", "moderator", "grandchampion"]
}
When /bulktoken is run, a JWT with the following format is produced
Code (Text):
{
   exp: 1600829926,
   players: [{
       disallowAuth: true,  // indicating this token does not allow one to identify as this player
       uuid: "48c3d9ce-19b7-4bb0-b3d2-d0260f0976b3",
       groups: ["admin", "moderator", "grandchampion"]
   }, {
       disallowAuth: true,
       uuid: "48c3d9ce-19b7-4bb0-b3d2-d0260f0976b3",
       groups: ["elder"]
   }]
}
Compile from source
Code (Text):
mvn install
License
This source code is dual-licensed under choice of CC0 or MIT. See LICENSE and LICENSE-MIT

Contributing

By making a contribution to this repository, I certify that:

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

VaultJwt is a free Minecraft Java mod. Compatible with Minecraft 1.13, 1.14, 1.15, 1.16. Downloaded 58 times (via Spigot). Download it and open it directly in the game.

Explore more