Authenticating to the Epic Games Services (EGS) API

Step 1: Obtain an Authentication Code for your Account

1
2
3
4
5
{
    "redirectUrl": "com.epicgames.fortnite://fnauth/?code=155064ef39b144f4b1ffd6fac4905c86",
    "authorizationCode": "155064ef39b144f4b1ffd6fac4905c86",
    "sid": null
}

Copy the value of the authorizationCode which, in this case, would be: 155064ef39b144f4b1ffd6fac4905c86


Step 2: Use the Authorization Code to Generate an Access Token

NOTE: The auth code expires after 5 minutes. If Step 2 is not completed within 5 minutes of Step 1, you will have to obtain a new Authorization Code.

  • To generate an Access Token, you will be sending a POST request to the following URL: https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token with the following configuration:
    • Headers:
      • Content-Type: application/x-www-form-urlencoded
      • Authorization: basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=
    • Body:
      • grant_type: authorization_code
      • code: YOUR_AUTHORIZATION_CODE_FROM_STEP_1

Example in cURL

1
2
3
4
curl -X POST -Url "https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token" 
-H "Content-Type: application/x-www-form-urlencoded" 
-H "Authorization: basic MzQ0NmNkNzI2OTRjNGE0NDg1ZDgxYjc3YWRiYjIxNDE6OTIwOWQ0YTVlMjVhNDU3ZmI5YjA3NDg5ZDMxM2I0MWE=" 
-d "grant_type=authorization_code&code=4752aaac6e524d0da97a3c766966357a"
Edit

Pub: 29 Jun 2023 20:02 UTC

Views: 853