Authenticates using an Epic Games exchange code. This authentication method requires obtaining an exchange code from Epic Games endpoints.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/xmistt/rebootpy/llms.txt
Use this file to discover all available pages before exploring further.
The method to get an exchange code has been significantly harder since Epic patched the old method of copying the code from one of their own endpoints that could be requested easily in a browser.To obtain an exchange code, it is recommended to provide a custom solution like running a selenium process where you log in on https://epicgames.com and then redirect to
/id/api/exchange/generate. You can then return the exchange code. You can put this solution in a function and then pass this to exchange_code.Class Signature
Parameters
The exchange code or a function/coroutine that when called returns the exchange code.This allows you to provide:
- A string:
"your-exchange-code-here" - A function:
lambda: get_code_from_selenium() - An async function:
async def get_code(): return await fetch_exchange_code()
A 32 char hex string representing your device.
The main Fortnite token to use with authentication. You should generally not need to set this manually.
Properties
The Authorization header for use with Fortnite endpoints. Use this if you’re making HTTP requests that aren’t already implemented.
Returns the resolved exchange code.
The exchange code after it has been resolved from the callable/awaitable.
Methods
resolve
The code to resolve.
TypeError: If the callable doesn’t return a string
ios_authenticate
The request priority.
AuthException: If the exchange code is invalid or expired
authenticate
The request priority.
- Updates iOS token data
- Kills other sessions (if
client.kill_other_sessionsisTrue) - Obtains and updates chat, EAS, and EOS tokens
- Sets up the client user
Example Usage
With a static code
With a function
With an async function
Error Handling
If the exchange code is invalid or expired, anAuthException is raised with the message:
How to Obtain an Exchange Code
Since Epic Games patched the easy method, here are recommended approaches:1. Selenium/Playwright Automation
2. Browser Extension
Create a browser extension that intercepts the exchange code endpoint and copies the code to clipboard.3. Manual Console Method
For development/testing:- Log in to https://www.epicgames.com
- Open browser console
- Navigate to
/id/api/exchange/generate - Copy the code from the JSON response
Comparison with AuthorizationCodeAuth
- ExchangeCodeAuth: Requires custom automation to obtain codes
- AuthorizationCodeAuth: Easier to obtain codes from a simple redirect URL
AuthorizationCodeAuth is recommended unless you specifically need exchange codes.