Coder Social home page Coder Social logo

prismarine-auth's People

Contributors

atxltheaxolotl avatar dependabot[bot] avatar dustinrue avatar extremeheat avatar ghqstmc avatar jtsiskin avatar kashalls avatar lucienhh avatar nciklol avatar panva avatar paulomart avatar rom1504 avatar safazi avatar u9g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

prismarine-auth's Issues

Xbox Country Locks Accounts

  • The readme doesn't contain a resolution to my issue
  • The example doesn't contain a resolution to my issue

Versions

  • node: 16.15.0
  • prismarine-auth: 1.5.2

Detailed description of a problem

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.

https://github.com/microsoft/xbox-live-api/blob/730f579d41b64df5b57b52e629d12f23c6fb64ac/Source/Shared/errors_legacy.h#L924

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.


Misleading error description

  • The readme doesn't contain a resolution to my issue
  • The example doesn't contain a resolution to my issue

Versions

  • node: 16.15.0
  • prismarine-auth: ^1.7.0

Detailed description of a problem

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

`getTitleToken` does not work { doSisuAuth: false, authTitle: Titles.MinecraftJava, deviceType: "Win32" }

  • The readme doesn't contain a resolution to my issue
  • The example doesn't contain a resolution to my issue

Versions

  • node: 17.7.2
  • prismarine-auth: 1.7.0

Detailed description of a problem

When I set doSisuAuth to false and set authTitle to MinecraftJava, It always returns an error: 403 Forbidden

image

Your current code

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)

Expected behavior

return tokens without error

Additional context

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?


CommonJS ?

Clear question

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 ?

How to get login user's XUID

  • The readme doesn't contain a resolution to my issue
  • The example doesn't contain a resolution to my issue

Versions

  • mineflayer: #.#.#
  • server: vanilla/spigot/paper #.#.#
  • node: #.#.#

Clear question

A clear question, with as much context as possible.
What are you building? What problem are you trying to solve?

What did you try yet?

Did you try any method from the API?
Did you try any example? Any error from those?

Your current code

Please put here any custom code you tried yet.

/*
Some code here, replace this
*/

Additional context

Add any other context about the problem here.

Rename to prismarine-auth

The ideal state is 2 libs:

  1. One lib that handle all stuff Xbox live
  2. One lib that handle Minecraft auth

Steps:

  1. Rename this repo to prismarine-auth and publish it, start using it
  2. Extract whatever is generic from here, and put it in a fork of xboxlive-auth. Try to PR it, if they don't like it for any reason, then publish the fork under prismarine-xboxlive-auth and use it in prismarine-auth

When using `doSisuAuth` cached token is never returned.

Detailed description of a problem

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.

Expected behavior

When using doSisuAuth return the cached XSTS token instead of refreshing.

Additional context

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


Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.