Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
A Node.js client for doing requests to yggdrasil, the Mojang authentication system, used for Minecraft and Scrolls.
$ npm install yggdrasil
//init
const ygg = require('yggdrasil')({
//Optional settings object
host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.
});
//Authenticate a user
ygg.auth({
token: '', //Optional. Client token.
agent: '', //Agent name. Defaults to 'Minecraft'
version: 1, //Agent version. Defaults to 1
user: '', //Username
pass: '', //Password
requestUser: false //Optional. Request the user object to be included in response
}).then(
(response)=>{},
(error)=>{}
);
//Refresh an accessToken
ygg.refresh(oldAccessToken, clientToken, true).then(
({accessToken, clientToken, user?})=>{},
(error)=>{}
);
// Note that requestUser is an optional parameter. If set to true, it requests the user object from Mojang's authentication servers as well.
//Validate an accessToken
ygg.validate(token).then(
(response)=>{},
(error)=>{}
);
//Invalidate all accessTokens
ygg.signout(username, password).then(
(response)=>{},
(error)=>{}
);
const yggserver = require('yggdrasil').server({
//Optional settings object
host: 'https://authserver.mojang.com' //Optional custom host. No trailing slash.
});
//Join a server (clientside)
yggserver.join(token, profile, serverid, sharedsecret, serverkey).then(
(response)=>{},
(error)=>{}
);
//Join a server (serverside)
yggserver.hasJoined(username, serverid, sharedsecret, serverkey).then(
(clientInfo)=>{},
(error)=>{}
);
const ProxyAgent = require('proxy-agent');
const ygg = require('yggdrasil')({
//Any type of HTTP Agent
agent: new ProxyAgent('https://example.com:8080')
});
/**
* Import Client or Server from 'yggdrasil/es6'.
* Note that the library is stateless when imported this way vs the CommonJS way.
* You have typings though ;D
*/
import { Client as ygg, Server as yggServ } from 'yggdrasil/es6'
// Use it like you normally would.
ygg.validate(token).then(
(response)=>{},
(error)=>{}
);
yggServ.join(token, profile, serverid, sharedsecret, serverkey).then(
response=>{},
error=>{}
);
FAQs
Mojang authentication (Yggdrasil) client
We found that yggdrasil demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.