Comments (17)
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.
Use the ones in Readme
from fortnite-api.
I tried, but it doesn't work...
from fortnite-api.
Can you show your code?
from fortnite-api.
from fortnite-api.
it works for me, do you have 2 factor authentification ?
from fortnite-api.
from fortnite-api.
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.
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.
431 Request Header Fields Too Large
This can be caused because one of the fields in the header is too long
from fortnite-api.
This error is strange combined my password and email address are only 35 characters in length.
from fortnite-api.
I know that sometimes, 2FA generate some problems in login. Can you try to disable it and try again ?
from fortnite-api.
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.
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.
Yes, no problem I will edit the readme ;).
from fortnite-api.
Sorry for the long absence.
I just did what you were advised and it works
Thank you very much !
from fortnite-api.
I want the new fortnite api
from fortnite-api.
Related Issues (20)
- UnhandledPromiseRejectionWarning: #<Object> HOT 3
- s
- Add supported languages to the readme HOT 3
- [FEATURE] Endpoint for match list HOT 3
- [BUG] language bug HOT 4
- Problems picking the tokens
- [FEATURE] Get username HOT 2
- [FEATURE] Tournament Endpoint HOT 3
- [BUG] Sorry your client is not allowed to use the grant type password HOT 12
- Events endpoint is sending cached data
- Default tokens don't work anymore [BUG] HOT 1
- [Help Wanted] - Client & Launcher Tokens HOT 3
- [READ BEFORE] Update about fortnite-api
- [BUG]
- Closed HOT 1
- [BUG] Impossible to connect
- [FEATURE]
- [BUG] when i try to put in a code in rl activate so i can redeem my beta nugget it says errors.com.epicgames.common.throttle
- auto gifting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fortnite-api.