Authme Connect with Flarum
Let's log in Minecraft by Flarum Account
(I have a poor English,Forgive my Grammatical errors.)
(If you have enough time,You can help me improve this post!)
Part 1.Ready
There is some need to ready things.
1.A Spigot/Paper or whatelse support Authme/Other support BCrybt account protect plugin Server
I'm using PaperSpigot on Minecraft 1.12.2
2.A Authme Plugin and installed for Minecraft Server
I'm using Authme Reloaded
3.A installed Flarum Forum
I'm using Flarum-CV 1.7(Based Flarum 0.8 dev)
Test result:Support 0.7.1 Offical version too
4.A MySQL Database allow connect from Authme side
I'm using MariaDB,Support MySQL too.
Part 2.Configuration Authme
Flarum using the BCrybt to protect the password.Very coincidence,Authme support it from very early version.
Of course,You can other protect plugin--Just it support BCrybt and MySQL!
I will use @ to mark the myself Comments
Please delete that when you save the config
Open plugins/Authme/config.yml
and edit it!
First,Let's search this part and edit it like under demo!
DataSource:
# What type of database do you want to use?
# Valid values: SQLITE, MYSQL
backend: 'mysql' @Choose mysql
# Enable database caching, should improve database performance
caching: false @Toggle to FALSE
# Database host address
mySQLHost: '123.123.123.123' @You Flarum Database Host
# Database port
mySQLPort: '23333' @You Flarum Database Port
# Connect to MySQL database over SSL
mySQLUseSSL: false @If you Database support SSL connection,You can open this.
# Username to connect to the MySQL database
mySQLUsername: 'root' @You Flarum Database Username,Must have READ permission for this user.
# Password to connect to the MySQL database
mySQLPassword: '12345678' @You Flarum Database user's password
# Database Name, use with converters or as SQLITE database name
mySQLDatabase: 'flarum' @You Flarum using Database name
# Table of the database
mySQLTablename: 'flarum_users' @Flarum Tablename [TablePrefix+users]
# Column of IDs to sort data
mySQLColumnId: 'id' @Set this to id
# Column for storing or checking players nickname
mySQLColumnName: 'username' @Set this to username
# Column for storing or checking players RealName
mySQLRealName: 'username' @There need set to username too
Okay,Look like you already finish first part!
Next,Let's We search this part and edit it like under demo:
ExternalBoardOptions:
# Column for storing players passwords salts
mySQLColumnSalt: '' @Keep the null
# Column for storing players groups
mySQLColumnGroup: '' @Keep the null
# -1 means disabled. If you want that only activated players
# can log into your server, you can set here the group number
# of unactivated users, needed for some forum/CMS support
nonActivedUserGroup: -1 @Set the -1
# Other MySQL columns where we need to put the username (case-sensitive)
mySQLOtherUsernameColumns: [] @Keep this default
# How much log2 rounds needed in BCrypt (do not change if you do not know what it does)
bCryptLog2Round: 10 @Must set to 10
# phpBB table prefix defined during the phpBB installation process
phpbbTablePrefix: 'phpbb_'
# phpBB activated group ID; 2 is the default registered group defined by phpBB
phpbbActivatedGroupId: 2
# IP Board table prefix defined during the IP Board installation process
IPBTablePrefix: 'ipb_'
# IP Board default group ID; 3 is the default registered group defined by IP Board
IPBActivatedGroupId: 3
# XenForo default group ID; 2 is the default registered group defined by Xenforo
XFActivatedGroupId: 2
# Wordpress prefix defined during WordPress installation
wordpressTablePrefix: 'wp_'
Continue edit the config to disable Authme side registration
Because allow register on Authme side maybe will break you database.
registration:
# Enable registration on the server?
enabled: false @Set to true for disable Authme side registration,If you enable this,you database may broken!
# Send every X seconds a message to a player to
# remind him that he has to login/register
messageInterval: 5
# Only registered and logged in players can play.
# See restrictions for exceptions
force: true
# Type of registration: PASSWORD or EMAIL
# PASSWORD = account is registered with a password supplied by the user;
# EMAIL = password is generated and sent to the email provided by the user.
# More info at https://github.com/AuthMe/AuthMeReloaded/wiki/Registration
type: 'PASSWORD'
# Second argument the /register command should take: NONE = no 2nd argument
# CONFIRMATION = must repeat first argument (pass or email)
# EMAIL_OPTIONAL = for password register: 2nd argument can be empty or have email address
# EMAIL_MANDATORY = for password register: 2nd argument MUST be an email address
secondArg: 'CONFIRMATION'
# Do we force kick a player after a successful registration?
# Do not use with login feature below
forceKickAfterRegister: false
# Does AuthMe need to enforce a /login after a successful registration?
forceLoginAfterRegister: false
Final,Disable can login when no registered
You can edit plugins/Authme/messages.yml
to custom the kick when non registered message!
ForceSpawnLocOnJoin:
# If enabled, every player that spawn in one of the world listed in
# "ForceSpawnLocOnJoin.worlds" will be teleported to the spawnpoint after successful
# authentication. The quit location of the player will be overwritten.
# This is different from "teleportUnAuthedToSpawn" that teleport player
# to the spawnpoint on join.
enabled: false
# WorldNames where we need to force the spawn location
# Case-sensitive!
worlds:
- 'world'
- 'world_nether'
- 'world_the_end'
# This option will save the quit location of the players.
SaveQuitLocation: false
# To activate the restricted user feature you need
# to enable this option and configure the AllowedRestrictedUser field.
AllowRestrictedUser: false
# The restricted user feature will kick players listed below
# if they don't match the defined IP address. Names are case-insensitive.
# Ip addresses support regex expressions (regex:127\.0\.0\..*)
# Example:
# AllowedRestrictedUser:
# - playername;127.0.0.1
# - playername;regex:127\.0\.0\..*
AllowedRestrictedUser: []
# Ban unknown IPs trying to log in with a restricted username?
banUnsafedIP: false
# Should unregistered players be kicked immediately?
kickNonRegistered: true @Set true to deny NonRegistered player to login server.
# Should players be kicked on wrong password?
kickOnWrongPassword: false
# Should not logged in players be teleported to the spawn?
# After the authentication they will be teleported back to
# their normal position.
teleportUnAuthedToSpawn: false
# Can unregistered players walk around?
allowMovement: false
# After how many seconds should players who fail to login or register
# be kicked? Set to 0 to disable.
timeout: 60
# Regex pattern of allowed characters in the player name.
allowedNicknameCharacters: '[a-zA-Z0-9_]*'
# How far can unregistered players walk?
# Set to 0 for unlimited radius
allowedMovementRadius: 100
# Should we protect the player inventory before logging in? Requires ProtocolLib.
ProtectInventoryBeforeLogIn: true
# Should we deny the tabcomplete feature before logging in? Requires ProtocolLib.
DenyTabCompleteBeforeLogin: false
# Should we display all other accounts from a player when he joins?
# permission: /authme.admin.accounts
displayOtherAccounts: true
# Spawn priority; values: authme, essentials, multiverse, default
spawnPriority: 'authme,essentials,multiverse,default'
# Maximum Login authorized by IP
maxLoginPerIp: 0
# Maximum Join authorized by IP
maxJoinPerIp: 0
# AuthMe will NEVER teleport players if set to true!
noTeleport: false
# Regex syntax for allowed chars in passwords
allowedPasswordCharacters: '[\x21-\x7E]*'
# Threshold of the other accounts command, a value less than 2 means disabled.
otherAccountsCmdThreshold: 0
# Command to run when a user has more accounts than the configured threshold.
# Available variables: %playername%, %playerip%
otherAccountsCmd: 'say The player %playername% with ip %playerip% has multiple accounts!'
Thanks @rriivasss point the another things need to modify.
security:
# Minimum length of password
minPasswordLength: 5
# Maximum length of password
passwordMaxLength: 30
# Possible values: SHA256, BCRYPT, BCRYPT2Y, PBKDF2, SALTEDSHA512,
# MYBB, IPB3, PHPBB, PHPFUSION, SMF, XENFORO, XAUTH, JOOMLA, WBB3, WBB4, MD5VB,
# PBKDF2DJANGO, WORDPRESS, ROYALAUTH, ARGON2, CUSTOM (for developers only). See full list at
# https://github.com/AuthMe/AuthMeReloaded/blob/master/docs/hash_algorithms.md
# If you use ARGON2, check that you have the argon2 c library on your system
passwordHash: BCRYPT @THIS ONE FROM SHA256 TO BCRYPT
# If a password check fails, AuthMe will also try to check with the following hash methods.
# Use this setting when you change from one hash method to another.
# AuthMe will update the password to the new hash. Example:
# legacyHashes:
# - 'SHA1'
legacyHashes: []
Part 3.Finish!
Now,You Authme should already connect to you Flarum forum!
Type authme reload
in console to apply the new config.yml!
Click a Like to support me! Thanks!