LeleDerGrasshalmi / FortniteEndpointsDocumentation

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

how to enable scopes perms #246

Closed gromaxbro closed 6 months ago

gromaxbro commented 6 months ago

how to fix this error :

{"errorCode":"errors.com.epicgames.common.missing_permission","errorMessage":"Sorry your login does not posses the permissions 'account:public:account READ' needed to perform the requested operation","messageVars":["account:public:account","READ"],"numericErrorCode":1023,"originatingService":"com.epicgames.account.public","intent":"prod"}

code :


session = requests.Session()
headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic thsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrsrtsh=="
}

data = {
    "scope":"account:public:account READ",

    "grant_type": "client_credentials", 
    "password": "waofeasf",
    "username": "ggosetsfs"

}

response = session.post("https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token", headers=headers, data=data)

print(response.text)

headers = {
        "Authorization": "bearer "+response.json()["access_token"]
}
uer = session.get(" https://account-public-service-prod.ol.epicgames.com/account/api/public/account/displayName/adwaidmia",headers=headers)

print(uer.text)
LeleDerGrasshalmi commented 6 months ago

hi,

  1. of all, WHY are you sending a password & "username"/email in the client credentials body???
  2. The specified you are using does not has the required permissions

to lookup an account you need account authentication

gromaxbro commented 6 months ago

@LeleDerGrasshalmi sry i am new to this api ik password & "username"/email only require if grand_type is password

but your docs say account:public:account i dont know how to do that how to authenticate can you help?

LeleDerGrasshalmi commented 6 months ago

what client are you using=

gromaxbro commented 6 months ago

@LeleDerGrasshalmi yours docs

fortnitePCGameClient | ec684b8c687f479fadea3cb2ad83f5c6 | e1f31c211f28413186262d37a13fc84d

LeleDerGrasshalmi commented 6 months ago

yea, as i said you cannot use that api with client credentials since that perm isnt on client auth. you need account auth, so any grant type expect client_credentials

gromaxbro commented 6 months ago

then how can i access https://account-public-service-prod.ol.epicgames.com/account/api/public/account/displayName

LeleDerGrasshalmi commented 6 months ago

you need account auth, so any grant type expect client_credentials

gromaxbro commented 6 months ago

@LeleDerGrasshalmi thx i will use exchange code then why dont client_creds work tho?

LeleDerGrasshalmi commented 6 months ago

because client auth does not have the required permission

Jaren8r commented 6 months ago

fwiw - the client credentials for utDedicatedServer has this permission, so you don't need account auth.

gromaxbro commented 6 months ago

alr thx!

HyperionCSharp commented 6 months ago

Lele is right you have to pass correct client creds to access the in scope permissions like read/write/create. The grant type password is currently deprecated on public clients and will be full omitted in OAuth2.1 as its function is not needed and its bad practice. You can try to access the dev portal and use the private client creds to pass permissions (must have a verified application on the portal). If nothing works try using exchange code endpoint. Hope this helps a little

sry to budge in lele

LeleDerGrasshalmi commented 6 months ago

EOS and actual game clients are 2 different things.

EOS works with scopes & policies. Game/web/normal Clients work with permissions

also i dont see the need of opening this issue again