LeleDerGrasshalmi / FortniteEndpointsDocumentation

Fortnite & Epic Games Unofficial API Documentation
233 stars 65 forks source link

Unable to proceed with auth #272

Closed tposejank closed 3 months ago

tposejank commented 3 months ago

Issue Checklist

What is the Request Method?

POST

What is the Request URL?

https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token

What are your Request Headers (if applicable)?

Authorization: Basic ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ=

What are your Request Payload/Body (if applicable)?

None

What is the Response Status Code?

400

What are the Response Headers (if applicable)?

Epic Error Code 1016 errors.com.epicgames.common.oauth.unsupported_grant_type

What is the Response Content? (if applicable)

{
    "errorCode": "errors.com.epicgames.common.oauth.unsupported_grant_type",
    "errorMessage": "Malformed grant type in token request: null",
    "messageVars": [],
    "numericErrorCode": 1016,
    "originatingService": "com.epicgames.account.public",
    "intent": "prod",
    "error_description": "Malformed grant type in token request: null",
    "error": "unsupported_grant_type"
}

Additional Context (if applicable)

Hello, i have an issue, I am just trying to obtain an eg1 token at the https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token URL I have included the grant_type param as authorization_code and the code param as the one I obtain from https://www.epicgames.com/id/api/redirect?responseType=code&clientId=ec684b8c687f479fadea3cb2ad83f5c6 (logged in) (fortnitePCGameClient id)

However, I keep getting a "Malformed grant type in token request" on the response screenshot from postman

I don't know if i am missing any steps I also tried the token_type eg1 param (described in the docs) with no success (same error)

Is there something wrong I am doing? Also, I believe the eg1 token is needed to access https://events-public-service-live.ol.epicgames.com/ which is what I am trying to do, if it isnt or there is any other recommended way to get this token could you tell me? Like alternate grant types (I couldnt get device auth working too, the required Auth isnt really described well in here, as i got this errors.com.epicgames.common.authentication.authentication_failed error)

LeleDerGrasshalmi commented 3 months ago

Hi,

  1. yes the authorization code is sensitive
  2. you are supplying the "grant_type" and "code" as a query parameter (in the url) but they need to be in the "Body" as ``. Check out the example requests how to auth here. In postman it's done like this: image
  3. regarding eg1 tokens, i would recommend to always use them, you can easily get info about the session without sending a request (to the verify api) and certain apis require you to supply an eg1 token

hope this helps

tposejank commented 3 months ago

Yeah, I seem to have fixed the issue Could you help me with something else? https://events-public-service-live.ol.epicgames.com/api/v2/games/FNFestival/leaderboards/season003_54a2b46e-7fc7-4ec9-869f-e011fd8b41a6/54a2b46e-7fc7-4ec9-869f-e011fd8b41a6_Solo_Vocals/scores?accountId=3554e7171c554bdc8b38edb226fe6b0f&fromIndex=0&findTeams=false I try accessing this

Using the eg1 token (Bearer eg1) i got, this response { "errorCode": "com.epicgames.api.malformed_data", "errorMessage": "com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input\n at [Source: (byte[])\"\"; line: 1, column: 0]" }

image image image

I dont recognize this kind of error

LeleDerGrasshalmi commented 3 months ago

you disabled the content length header, so the api doesnt know anything about a body/payload, so it fails to parse it.

image

tposejank commented 3 months ago

Yeah, seem to have got it right after countless attempts! Thanks Lele!

tposejank commented 3 months ago

By the way, I can't seem to find docs about the festival leaderboards, would you like if I made some?

LeleDerGrasshalmi commented 3 months ago

np and you dont need to add them, i will eventually add them

tposejank commented 3 months ago

Alright