prismarinejs / prismarine-auth Goto Github PK
View Code? Open in Web Editor NEWMicrosoft/Xbox Live authentication
License: MIT License
Microsoft/Xbox Live authentication
License: MIT License
When using some VPN's (and I assume maybe that specific country), Xbox Live may return the code: 0x8015DC0B
or 2148916235
in decimal. This seems to be only affecting Russian users due to issues seen worldwide.
We could also use this time to implement more verbose codes if needed.
I am using this issue to provide a "Implement This" for myself.
If an account fails to login due to suspicious activities (happens when logging in from new IP's, etc.), this error is thrown: XboxReplayError: Invalid credentials.
even though the credentials are correct
When I set doSisuAuth
to false and set authTitle
to MinecraftJava, It always returns an error: 403 Forbidden
const { Authflow, Titles } = require('prismarine-auth')
module.exports = doAuth = async (id,cache) => {
// not work
const flow = new Authflow(id,cache, { doSisuAuth: false, authTitle: Titles.MinecraftJava, deviceType: 'Win32' })
const response = await flow.getXboxToken()
console.log(response)
}
(from /examples/xbox/sisu.js)
return tokens without error
I found getTitleToken
function always failed to request. XboxTokenManager.js
I also tried another options and it works fine:
const flow = new Authflow(id,cache, { doSisuAuth: false, authTitle: Titles.MinecraftNintendoSwitch, deviceType: 'Nintendo' })
Isn't it allowed to request title authentication with Titles.MinecraftJava?
Wondering why the usage of commonJs while it's deprecated since middle age ?
As it gets us errors like
import { Authflow, Titles } from 'prismarine-auth'
^^^^^^
SyntaxError: Named export 'Titles' not found. The requested module 'prismarine-auth' is a CommonJS module, which may not support all module.exports as named exports.
It's not really a problem but more like is there any reason to not use es modules ?
prismarine-auth/src/MicrosoftAuthFlow.js
Line 75 in 0223a23
since v14.14.0 In future versions of Node.js and will trigger a warning fs.rmdir(path, { recursive: true }) will throw if path does not exist or is a file. Use fs.rm(path, { recursive: true, force: true }) instead.
See history: https://nodejs.org/api/fs.html#fs_fspromises_rmdir_path_options
A clear question, with as much context as possible.
What are you building? What problem are you trying to solve?
Did you try any method from the API?
Did you try any example? Any error from those?
Please put here any custom code you tried yet.
/*
Some code here, replace this
*/
Add any other context about the problem here.
should we move anything there ? should we depend on their last version ? or should we not depend on them at all ?
follow up of #5
The ideal state is 2 libs:
Steps:
Currently when using doSisuAuth
the verifyTokens
function in XboxTokenManager will always return false thus forcing a token refresh on every call, this is because of the follwing snippet of code
const ut = await this.getCachedUserToken()
const xt = await this.getCachedXstsToken()
if (!ut || !xt || this.forceRefresh) {
return false
}
Sisu auth flow doesn't generate a userToken because userToken, deviceToken and titleToken are all returned in the sisu response however we only cache the xsts token.
When using doSisuAuth
return the cached XSTS token instead of refreshing.
Ideally, we need to cache the returned tokens from sisu and have a solution that uses all available tokens in the cache to generate an xsts token after the current one expires as well as change the verifyTokens function to check all tokens
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.