Giter Site home page Giter Site logo

Can't get launcher tokens about fortnite-api HOT 17 CLOSED

Lk2v avatar Lk2v commented on June 2, 2024
Can't get launcher tokens

from fortnite-api.

Comments (17)

MrPowerGamerBR avatar MrPowerGamerBR commented on June 2, 2024 1

Also, a tip for anyone that tried creating a alt Epic Games account to use the API (just so you didn't need to disable 2FA on your main account): You need to login into Fortnite at least once, if you don't do that, the API will throw 403 Forbidden (and some endpoints, like the player status, will return "Player not found" even if the player exists)

@qlaffont I think it would be nice if you added to the readme that:

  • You need to disable two factor authentication before using the API, or else it will throw errors
  • You need to login at least once to Fortnite to the API to work, if not it will throw 403 Forbidden errors.

Just so other people doesn't get stuck on the same issues! 😊

from fortnite-api.

vanerac avatar vanerac commented on June 2, 2024

Use the ones in Readme

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

I tried, but it doesn't work...

from fortnite-api.

vanerac avatar vanerac commented on June 2, 2024

Can you show your code?

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

here is my code :
Capture

from fortnite-api.

vanerac avatar vanerac commented on June 2, 2024

it works for me, do you have 2 factor authentification ?

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

Yes, I enabled it.
image

from fortnite-api.

vanerac avatar vanerac commented on June 2, 2024

I checked and it shouldn't be a problem,you could try and isable it to see if it fixes anything , when does it break, on startup? Or when I tries to get the refresh token?

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

It breaks at the time of the fortniteAPI.login() by putting a catch() I was able to get this information :

{ message:
   'Please enter good credentials (Login/Username/Launcher Token)',
  err:
   { Error: Request failed with status code 431
       at createError (D:\Projet\bot-fortnite-shop\node_modules\axios\lib\core\createError.js:16:15)
       at settle (D:\Projet\bot-fortnite-shop\node_modules\axios\lib\core\settle.js:17:12)
       at IncomingMessage.handleStreamEnd (D:\Projet\bot-fortnite-shop\node_modules\axios\lib\adapters\http.js:237:11)
       at IncomingMessage.emit (events.js:194:15)
       at endReadableNT (_stream_readable.js:1125:12)
       at process._tickCallback (internal/process/next_tick.js:63:19)
     config:
      { url:
         'https://account-public-service-prod03.ol.epicgames.com/account/api/oauth/token',
        method: 'post',
        data:
         'grant_type=password&username=<username>&password=<password>&includePerms=true',
        headers: [Object],
        transformRequest: [Array],
        transformResponse: [Array],
        timeout: 0,
        adapter: [Function: httpAdapter],
        responseType: 'json',
        xsrfCookieName: 'XSRF-TOKEN',
        xsrfHeaderName: 'X-XSRF-TOKEN',
        maxContentLength: -1,
        validateStatus: [Function: validateStatus] },
     request:
      ClientRequest {
        _events: [Object],
        _eventsCount: 6,
        _maxListeners: undefined,
        output: [],
        outputEncodings: [],
        outputCallbacks: [],
        outputSize: 0,
        writable: true,
        _last: true,
        chunkedEncoding: false,
        shouldKeepAlive: false,
        useChunkedEncodingByDefault: true,
        sendDate: false,
        _removedConnection: false,
        _removedContLen: false,
        _removedTE: false,
        _contentLength: null,
        _hasBody: true,
        _trailer: '',
        finished: true,
        _headerSent: true,
        socket: [TLSSocket],
        connection: [TLSSocket],
        _header:
         'POST /account/api/oauth/token HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/x-www-form-urlencoded\r\nAuthorization: basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=\r\nUser-Agent: axios/0.19.0\r\nContent-Length: 94\r\nHost: account-public-service-prod03.ol.epicgames.com\r\nConnection: close\r\n\r\n',  
        _onPendingData: [Function: noopPendingOutput],
        agent: [Agent],
        socketPath: undefined,
        timeout: undefined,
        method: 'POST',
        path: '/account/api/oauth/token',
        _ended: true,
        res: [IncomingMessage],
        aborted: undefined,
        timeoutCb: null,
        upgradeOrConnect: false,
        parser: null,
        maxHeadersCount: null,
        _redirectable: [Writable],
        [Symbol(isCorked)]: false,
        [Symbol(outHeadersKey)]: [Object] },
     response:
      { status: 431,
        statusText: '',
        headers: [Object],
        config: [Object],
        request: [ClientRequest],
        data: [Object] },
     isAxiosError: true,
     toJSON: [Function] } }

from fortnite-api.

vanerac avatar vanerac commented on June 2, 2024

431 Request Header Fields Too Large

This can be caused because one of the fields in the header is too long

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

This error is strange combined my password and email address are only 35 characters in length.

from fortnite-api.

qlaffont avatar qlaffont commented on June 2, 2024

I know that sometimes, 2FA generate some problems in login. Can you try to disable it and try again ?

from fortnite-api.

qlaffont avatar qlaffont commented on June 2, 2024

To check, I have run my tests, and everything is working. (https://github.com/qlaffont/fortnite-api/blob/master/test/index.js)

TOKEN_LAUNCHER="MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=";
TOKEN_CLIENT="ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ=";

from fortnite-api.

MrPowerGamerBR avatar MrPowerGamerBR commented on June 2, 2024

Can confirm, you need to disable two factor authentication of your Epic Games account, if not, the API will throw 431 Request Header Fields Too Large

from fortnite-api.

qlaffont avatar qlaffont commented on June 2, 2024

Yes, no problem I will edit the readme ;).

from fortnite-api.

Lk2v avatar Lk2v commented on June 2, 2024

Sorry for the long absence.
I just did what you were advised and it works
Thank you very much !

from fortnite-api.

DanyIonut2580 avatar DanyIonut2580 commented on June 2, 2024

I want the new fortnite api

from fortnite-api.

Related Issues (20)

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.