Discord2FA is a plugin that enables servers to implement 2FA using Discord.
When a player who has Discord2FA enabled logs in, the bot will throw a message in the designated channel and wait for a checkmark reaction. It'll leave its own reaction of a checkmark in order to prevent having to manually select the checkmark reaction every time.
The plugin will store user data (UUIDs, IPs and Discord names & discriminators) via MySQL.
The bot will be running within the plugin. It does not rely on any other services or bots, and for that reason there's a brief setup that needs to take place through Discord's API website. You'll have to insert your bot into a server channel where all 2FA enabled players are. Due to the nature of Discord, it's not easy to handle this all over PMs without the bot adding everyone as a friend, which isn't optimal.
The IPCheck option in the config defines whether you want to only require 2FA when an IP change occurs, or upon every single login.
The bot will delete its message as soon as the correct Discord user reacts with a checkmark.
There is currently only a BungeeCord version but a Spigot version would be very easy to make. It's intended to leave the player stuck in a hub server without being able to type or switch servers, but they can move around the world and interact with menus (again, being unable to switch servers). We'd need a Spigot version to prevent movement - but I figure that shouldn't matter in a hub.
Combine this with Discord's own 2FA and you're very secure.
I don't know what I'm doing here. Just figured I'd see if anyone would be interested in this authentication method. I'd sell this $4.99 or exclusively for a lot more. Exclusive is preferable. It's not up for automatic purchase (ie resource section) at this time. PM me.
When a player who has Discord2FA enabled logs in, the bot will throw a message in the designated channel and wait for a checkmark reaction. It'll leave its own reaction of a checkmark in order to prevent having to manually select the checkmark reaction every time.
Code:
MySQL:
Host: localhost
Port: '3306'
Username: root
Password: password
Database: Discord2FA
Discord:
Secret: your-secret-key
ChannelName: discord2fa
Strength:
IPCheck: false
Messages:
Prefix: ''
Typing: §4You must authenticate with Discord2FA before typing.
AccessDenied: §4You do not have access to use Discord2FA.
RegisterFormat: §4Use §c/twofactor register <discord-username>§ to set up Discord2FA.
List: §4This is a list of players with Discord2FA activated.
ManageDenied: §4You do not have access to manage Discord2FA.
SignedUp: §4You are already signed up for Discord2FA.
Received: §4You should have received a confirmation via Discord.
FullFormat: '§4An example of the correct format: §c/twofactor register Notch#9001§4.'
Success: §4You have successfully authenticated with Discord.
PlayerOffline: §4That player is offline.
ResetData: Their Discord2FA data has been reset.
NotSignedUp: That user does not have Discord2FA enabled.
The plugin will store user data (UUIDs, IPs and Discord names & discriminators) via MySQL.
The bot will be running within the plugin. It does not rely on any other services or bots, and for that reason there's a brief setup that needs to take place through Discord's API website. You'll have to insert your bot into a server channel where all 2FA enabled players are. Due to the nature of Discord, it's not easy to handle this all over PMs without the bot adding everyone as a friend, which isn't optimal.
The IPCheck option in the config defines whether you want to only require 2FA when an IP change occurs, or upon every single login.
The bot will delete its message as soon as the correct Discord user reacts with a checkmark.
There is currently only a BungeeCord version but a Spigot version would be very easy to make. It's intended to leave the player stuck in a hub server without being able to type or switch servers, but they can move around the world and interact with menus (again, being unable to switch servers). We'd need a Spigot version to prevent movement - but I figure that shouldn't matter in a hub.
- discord2fa.use - enable 2FA
- discord2fa.list - view a list of all players with 2FA enabled
- discord2fa.manage - reset a player's 2FA
Combine this with Discord's own 2FA and you're very secure.
I don't know what I'm doing here. Just figured I'd see if anyone would be interested in this authentication method. I'd sell this $4.99 or exclusively for a lot more. Exclusive is preferable. It's not up for automatic purchase (ie resource section) at this time. PM me.
Last edited:
