Closed esfesTheKing closed 4 years ago
What issue arises when trying to get an authorisation code exactly?
I was able to figure out how to get it in the end. Thank you for your research. I will post a solution later. I have another question the lookup of accounts by id, how do i look for more than 1 account at a time, and how do i get the name of players whom account is set to private?
Glad you got it working!
For multiple account ID lookups, check out this guide: e.g. if you wanted to lookup:
4735ce9132924caf8a5b17789b40f79c
3d9c055689d341d9b88a917630a6bdb9
3bebf5cdb9434fcfb455ef4807ae099c
... the URL for the request would look like: https://account-public-service-prod.ol.epicgames.com/account/api/public/account?accountId=4735ce9132924caf8a5b17789b40f79c&accountId=3d9c055689d341d9b88a917630a6bdb9&accountId=3bebf5cdb9434fcfb455ef4807ae099c
What do you mean by accounts that are set to private? To my knowledge, you should be able to get the account ID from a display name no matter what.
I am getting the display name from an account id, in my testing some of the accounts are set to private. When the account is set to private you are unable to get a diplay name. Thanks for your replay and for your hard work
And what is the difference between a 'displayName' and an 'externalDisplayName'
I'm unfamiliar with what you mean by accounts being "set to private".
I believe that the displayName
is the display name of the Epic account, where the externalDisplayName
is the display name of an external account (e.g. an XBOX account, PlayStation account, etc..).
i got an error once where i didnt find any displayName, so i went to fortnite tracker to see if there was a problem and it said something like can find an account that was set to private in game. but now i can recreate the issue any longer. I want to thank you once again for creating this repo and i would like to know if i can help in any way?
my solution, written in python.
The code it self:
import requests
code = '''
The code you got from this link https://www.epicgames.com/id/api/redirect?clientId=ec684b8c687f479fadea3cb2ad83f5c6&responseType=code
{"redirectUrl":"https://accounts.epicgames.com/fnauth?code=THE CODE YOU FOUND HERE","sid":null}
'''
def tokenObtainer(code):
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'Authorization': 'basic ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ=',
}
body = {
'grant_type': 'authorization_code',
'code': code
}
return requests.post('https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token', headers=headers, data=body).json()['access_token']
access_token = tokenObtainer(code)
Nice!
Feel free to create a PR if you find anything that isn't already documented.
Is there a way to get a permanent auth token?
You could use something like device auth to create a set of credentials that can be used to continuously generate an access token.
So there isnt a way to get a permanent access token?
No, access tokens expire after 8 hours.
*For security reasons
I was looking around the web and found this repo which can improve my programs exacute time. I am trying for the past 2 days to get an auth code with Authorization Code. I read the the instructions about 50 times and was still unable to get the auth code. My question is can you please give an example in some programming language, for example python?