yggdrasil
A Node.js client for doing requests to yggdrasil, the Mojang authentication system, used for Minecraft and Scrolls.
Usage
$ npm install yggdrasil
Client
const ygg = require('yggdrasil')({
host: 'https://authserver.mojang.com'
});
ygg.auth({
token: '',
agent: '',
version: 1,
user: '',
pass: '',
requestUser: false
}).then(
(response)=>{},
(error)=>{}
);
ygg.refresh(oldAccessToken, clientToken, true).then(
({accessToken, clientToken, user?})=>{},
(error)=>{}
);
ygg.validate(token).then(
(response)=>{},
(error)=>{}
);
ygg.invalidate(accessToken, clientToken).then(
(response)=>{},
(error)=>{}
);
ygg.signout(username, password).then(
(response)=>{},
(error)=>{}
);
Server
const yggserver = require('yggdrasil').server({
host: 'https://authserver.mojang.com'
});
yggserver.join(token, profile, serverid, sharedsecret, serverkey).then(
(response)=>{},
(error)=>{}
);
yggserver.hasJoined(username, serverid, sharedsecret, serverkey).then(
(clientInfo)=>{},
(error)=>{}
);
Proxy Support
const ProxyAgent = require('proxy-agent');
const ygg = require('yggdrasil')({
agent: new ProxyAgent('https://example.com:8080')
});
Further Reading