event_device_code_generated() event.
Class Signature
Parameters
Whether or not to automatically open the Epic Games login in the default browser.
The main Fortnite token to use with authentication. You should generally not need to set this manually.
The switch token to use with authentication. You should generally not need to set this manually.Default:
OThmN2U0MmMyZTNhNGY4NmE3NGViNDNmYmI0MWVkMzk6MGEyNDQ5YTItMDAxYS00NTFlLWFmZWMtM2U4MTI5MDFjNGQ3Properties
The Authorization header for use with Fortnite endpoints. Use this if you’re making HTTP requests that aren’t already implemented.
Returns the account ID.
Methods
eula_check_needed
False (device code auth doesn’t require EULA check)
ios_authenticate
The request priority.
- Obtains a switch token using client credentials
- Creates a device code
- Opens the verification URL in browser (if
open_link_in_browserisTrue) - Dispatches
device_code_generatedevent or prints the URL - Polls for user authorization
- Exchanges the device code for an access token
- Obtains an exchange code
- Exchanges the code for a session
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
reauthenticate
The request priority.
Example Usage
Error Handling
The device code flow handles several corrective actions automatically:- DATE_OF_BIRTH: If a date of birth is required, a random date is generated and submitted automatically
- Authorization pending: The method polls every 10 seconds until authorization is complete
AuthException is raised.
Events
Dispatched when the device code URL is generated.Parameters:
url(str): The verification URI to display to the user