Getting an Authorization Code
- Visit the authorization URL
- Log in to your Epic Games account (or log out and log in to a different account)
- Copy the
codeparameter from the redirected URL
An authorization code only works for a single login within a short timeframe (300 seconds). You need to get a new code for each login by refreshing the site.
Class Signature
Parameters
The authorization code or a function/coroutine that when called returns the authorization code.This allows you to provide:
- A string:
"your-auth-code-here" - A function:
lambda: get_code_from_somewhere() - An async function:
async def get_code(): return await fetch_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 authorization code.
Methods
ios_authenticate
The request priority.
AuthException: If the authorization code is invalid or expired
Inherited Methods
SinceAuthorizationCodeAuth extends ExchangeCodeAuth, it inherits the following methods:
authenticate
resolve
Example Usage
With a static code
With a function
With an async function
Error Handling
If the authorization code is invalid or expired, anAuthException is raised with the message:
Comparison with ExchangeCodeAuth
AuthorizationCodeAuth is a specialized version of ExchangeCodeAuth that uses the authorization_code grant type instead of exchange_code. The main differences are:
- AuthorizationCodeAuth: Uses codes from Epic’s authorization endpoint (easier to obtain)
- ExchangeCodeAuth: Uses exchange codes from Epic’s exchange endpoint (more complex to obtain)