AdvancedAuth is an intelligent authentication class that tries multiple authentication methods in order and automatically generates device auth credentials for future logins. This is the recommended authentication method for most applications.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.
Authentication Flow
AdvancedAuth attempts authentication in the following order:- DeviceAuth - If
device_id,account_id, andsecretare provided - DeviceCodeAuth - If
prompt_device_codeisTrue - ExchangeCodeAuth - If
exchange_codeis provided orprompt_exchange_codeisTrue - AuthorizationCodeAuth - If
authorization_codeis provided orprompt_authorization_codeisTrue
event_device_auth_generate event.
It is important to store the generated device auth values somewhere since they can be used for easier logins in the future.
Class Signature
Parameters
The exchange code or a function/coroutine that when called returns the exchange code.
The authorization code or a function/coroutine that when called returns the authorization code.
The device ID to use for the login.
The account ID to use for the login.
The secret to use for the login.
If this is set to
True and no valid device auth or code is available, the device code flow will be used.If this is set to
True and no exchange code is passed, you will be prompted to enter the exchange code in the console if needed.Both
prompt_exchange_code and prompt_authorization_code cannot be True at the same time.If this is set to
True and no authorization code is passed, you will be prompted to enter the authorization code in the console if needed.Both
prompt_exchange_code and prompt_authorization_code cannot be True at the same time.Whether to automatically open the device code link in the default browser.
Whether or not to prompt a code if the device auth details are invalid. If this is
False, then the regular AuthException is raised instead.This only works if
prompt_exchange_code or prompt_authorization_code is True.If this is set to
True and you receive a throttling response, you will be prompted to enter a code in the console.This only works if
prompt_exchange_code or prompt_authorization_code is True.Whether or not to delete all existing device auths when a new one is created.
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 account ID, authorization code, or exchange code.
Methods
eula_check_needed
exchange_code_ready
True if exchange code is set, False otherwise
authorization_code_ready
True if authorization code is set, False otherwise
code_ready
True if any code is available, False otherwise
device_auth_ready
True if device_id, account_id, and secret are all set, False otherwise
prompt_enabled
True if any prompt is enabled, False otherwise
get_prompt_type_name
'exchange' or 'authorization'
run_exchange_code_authenticate
run_authorization_code_authenticate
run_device_code_authenticate
run_device_authenticate
Device ID (uses instance value if not provided).
Account ID (uses instance value if not provided).
Secret (uses instance value if not provided).
Request priority.
ios_authenticate
Request priority.
authenticate
reauthenticate
Request priority.
Example Usage
Recommended setup (with device auth persistence)
With authorization code prompt
With existing authorization code
With invalid device auth fallback
Events
Dispatched when device auth credentials are generated.Parameters:
details(dict): Dictionary containingdevice_id,account_id, andsecret
Dispatched when a device code URL is generated (if using device code flow).Parameters:
url(str): The verification URI to display to the user
Best Practices
- Always save device auth credentials - Store them securely for future logins
- Use device code flow by default - Most user-friendly for first-time authentication
- Handle the
event_device_auth_generateevent - Essential for persistent authentication - Don’t commit credentials - Use
.gitignoreto exclude auth files - Implement fallbacks - Use
prompt_code_if_invalidfor robustness
Error Handling
AdvancedAuth handles many error scenarios automatically:- Invalid device auth - Falls back to other methods if
prompt_code_if_invalidis enabled - Expired codes - Can prompt for new codes
- Throttling - Can fall back to prompts if
prompt_code_if_throttledis enabled
Comparison with Other Auth Methods
| Feature | AdvancedAuth | DeviceAuth | AuthorizationCodeAuth | DeviceCodeAuth |
|---|---|---|---|---|
| First-time setup | Easy | Requires existing credentials | Manual code | Easy |
| Automatic device auth | Yes | N/A | No | No |
| Multiple fallbacks | Yes | No | No | No |
| User interaction | Optional | No | Yes | Yes |
| Best for | Most apps | Headless/automated | Simple scripts | Interactive apps |