MCAuth.js
A NodeJS library for validating Minecraft account information. Created for the serverside of Miney.
Installation
You can install using npm install mcauth
.
Usage
hasPaid To check if a user has bought Minecraft you can use mcauth.hasPaid:
var mcauth = ;mcauth;
checkSessionId When a user connects to a server they use a string called a sessionId to connect, you can validate a sessionId using mcauth.checkSessionId:
var mcauth = ;mcauth;
getMojangProfile Check a Minecraft username against Mojang's server. This allows you to get the player's UUID. The UUID should be used from now on for identification because coming with the Minecraft 1.8 update Mojang will allow the player to change their username.
var mcauth = ;mcauth;
getPlayerInformation This function takes a UUID and responds with a JSON object containing the player's current username and skin/cape information.
var mcauth = ;mcauth;
isNameValid To run a regexp check to make sure a username is a valid account name for Minecraft you can use mcauth.isNameValid:
var mcauth = ;mcauth;