
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
prismarine-auth
Advanced tools
Authentication library for Microsoft, Xbox Live, and Minecraft with caching support
Quickly and easily obtain auth tokens to authenticate with Microsoft/Xbox/Minecraft/Mojang
npm install prismarine-auth
Parameters
username
to get new ones on subsequent token requestsconst { Authflow, Titles } = require('prismarine-auth')
const userIdentifier = 'unique identifier for caching'
const cacheDir = './' // You can leave this as undefined unless you want to specify a caching directory
const flow = new Authflow(userIdentifier, cacheDir)
// Get a auth token, then log it
flow.getMsaToken().then(console.log)
Note: By default, this library will authenticate as Minecraft for Nintendo Switch, with a flow
set to live
. For non-Minecraft applications you should
register for Microsoft Azure Oauth token. See https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app#register-an-application for more information on obtaining an Azure token. You then use it with the msal
flow like this:
const flow = new Authflow(userIdentifier, cacheDir, { flow: 'msal', authTitle: '000-000-000-000' })
If flow
is live
, the default, then you can only specify existing Microsoft client IDs. This library exposes some default Microsoft client IDs under the exported Titles
object. See the types for more information.
See docs/API.md
const { Authflow, Titles } = require('prismarine-auth')
const userIdentifier = 'any unique identifier'
const cacheDir = './' // You can leave this as undefined unless you want to specify a caching directory
const flow = new Authflow(userIdentifier, cacheDir)
// Get a Minecraft Java Edition auth token, then log it
flow.getMinecraftJavaToken({ fetchProfile: true }).then(console.log)
{
"token": "ey....................",
"entitlements": {},
"profile": {
"id": "b945b6ed99b548675309473a69661b9a",
"name": "Usname",
"skins": [ [Object] ],
"capes": []
}
}
See docs/API.md and example.
See the types to checkout the full API.
See docs/API.md
You can enable some debugging output using the DEBUG
enviroment variable. Through node.js, you can add process.env.DEBUG = 'prismarine-auth'
at the top of your code.
Simply run npm test
or yarn test
FAQs
Authentication library for Microsoft, Xbox Live, and Minecraft with caching support
The npm package prismarine-auth receives a total of 5,944 weekly downloads. As such, prismarine-auth popularity was classified as popular.
We found that prismarine-auth demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.