Skip to main content
The base Auth class that all authentication methods inherit from. This class provides core authentication functionality and token management.

Class Signature

class Auth:
    def __init__(self, **kwargs: Any) -> None

Parameters

ios_token
str
The main Fortnite token to use with authentication. You should generally not need to set this manually.Default: M2Y2OWU1NmM3NjQ5NDkyYzhjYzI5ZjFhZjA4YThhMTI6YjUxZWU5Y2IxMjIzNGY1MGE2OWVmYTY3ZWY1MzgxMmU=
device_id
str
A 32 char hex string representing your device. Auto-generated if not provided.
token_type
str
The access token type. It’s recommended you only change this if you know what you’re doing as certain functions/API calls may start causing errors.Default: eg1

Properties

authorization
str
The Authorization header for use with Fortnite endpoints. Alias for ios_authorization.
ios_authorization
str
Returns bearer {ios_access_token} for iOS authentication.
chat_authorization
str
Returns bearer {chat_access_token} for chat authentication.
eas_authorization
str
Returns bearer {eas_access_token} for EAS authentication.
eos_authorization
str
Returns bearer {eos_access_token} for EOS authentication.
identifier
str
Returns the authentication identifier. Must be implemented by subclasses.

Methods

initialize

def initialize(client: 'BasicClient') -> None
Initializes the auth instance with a client.
client
BasicClient
required
The client instance to initialize with.

authenticate

async def authenticate(**kwargs) -> dict
Authenticates the client. Must be implemented by subclasses. Returns: Authentication data dictionary

reauthenticate

async def reauthenticate(priority: int = 0) -> dict
Re-authenticates the client. Must be implemented by subclasses.
priority
int
default:"0"
The request priority.

eula_check_needed

def eula_check_needed() -> bool
Returns whether EULA check is needed. Returns: True by default

get_eula_version

async def get_eula_version(**kwargs: Any) -> int
Gets the current EULA version. Returns: The EULA version number

accept_eula

async def accept_eula(**kwargs: Any) -> None
Accepts the EULA and grants Fortnite access.

get_exchange_code

async def get_exchange_code(*, auth='IOS_ACCESS_TOKEN', priority: int = 0) -> str
Gets an exchange code for authentication.
auth
str
default:"IOS_ACCESS_TOKEN"
The authorization type to use.
priority
int
default:"0"
The request priority.
Returns: The exchange code

exchange_code_for_session

async def exchange_code_for_session(token: str, code: str, *, priority: int = 0) -> dict
Exchanges an authorization code for a session.
token
str
required
The token to use for authentication.
code
str
required
The exchange code.
priority
int
default:"0"
The request priority.
Returns: Session data dictionary

grant_refresh_token

async def grant_refresh_token(refresh_token: str, auth_token: str, *, priority: int = 0) -> dict
Grants a new access token using a refresh token.
refresh_token
str
required
The refresh token.
auth_token
str
required
The authorization token.
priority
int
default:"0"
The request priority.
Returns: New token data

grant_chat_refresh_token

async def grant_chat_refresh_token(refresh_token: str, priority: int = 0) -> dict
Grants a new chat access token using a refresh token.
refresh_token
str
required
The chat refresh token.
priority
int
default:"0"
The request priority.
Returns: New chat token data

grant_eas_refresh_token

async def grant_eas_refresh_token(refresh_token: str, priority: int = 0) -> dict
Grants a new EAS access token using a refresh token.
refresh_token
str
required
The EAS refresh token.
priority
int
default:"0"
The request priority.
Returns: New EAS token data

grant_eos_external_auth_token

async def grant_eos_external_auth_token(external_auth_token: str, priority: int = 0) -> dict
Grants an EOS access token using an external auth token.
external_auth_token
str
required
The external auth token (typically the iOS access token).
priority
int
default:"0"
The request priority.
Returns: EOS token data (only when access_token_type is eg1)

get_ios_client_credentials

async def get_ios_client_credentials()
Gets iOS client credentials. Returns: Client credentials data

kill_token

async def kill_token(token: str) -> None
Kills/invalidates a specific token.
token
str
required
The token to kill.

kill_other_sessions

async def kill_other_sessions(auth: str = 'IOS_ACCESS_TOKEN', *, priority: int = 0) -> None
Kills all other active sessions.
auth
str
default:"IOS_ACCESS_TOKEN"
The authorization type to use.
priority
int
default:"0"
The request priority.

schedule_token_refresh

async def schedule_token_refresh() -> None
Schedules the next token refresh based on token expiration times.

run_refresh_loop

async def run_refresh_loop() -> None
Runs the continuous token refresh loop.

do_refresh

async def do_refresh() -> None
Performs a token refresh operation.

run_refresh

async def run_refresh() -> None
Triggers a token refresh and waits for completion.

refreshing

def refreshing() -> bool
Checks if a token refresh is currently in progress. Returns: True if refreshing, False otherwise

refresh_loop_running

def refresh_loop_running()
Checks if the refresh loop is currently running. Returns: True if running, False otherwise

fetch_device_auths

async def fetch_device_auths() -> List[dict]
Fetches all device authentications for the account. Returns: List of device auth dictionaries containing:
  • deviceId: The device ID
  • accountId: The account ID
  • userAgent: The user agent string
  • created: Creation information (location, IP, datetime)
  • lastAccess: Last access information (location, IP, datetime)

generate_device_auth

async def generate_device_auth() -> dict
Generates a new device authentication. Returns: Device auth dictionary containing:
  • deviceId: The generated device ID
  • accountId: The account ID
  • secret: The device secret (32 characters)
  • userAgent: The user agent string
  • created: Creation information

delete_device_auth

async def delete_device_auth(device_id: str) -> None
Deletes a device authentication.
device_id
str
required
The device ID to delete.

Source

View source: rebootpy/auth.py:52