Authentication
            spnkr.auth
    Logic for obtaining API credentials.
              AuthenticatedPlayer(player_id, gamertag, spartan_token, clearance_token, xbl_authorization_header_value)
  
      dataclass
  
    Information about an authenticated player.
Attributes:
| Name | Type | Description | 
|---|---|---|
| player_id | str | Xbox Live ID of the player. | 
| gamertag | str | The player's gamertag. | 
| spartan_token | SpartanToken | An expirable Spartan token required for all API endpoints. | 
| clearance_token | ClearanceToken | A clearance token required for some API endpoints. | 
| xbl_authorization_header_value | str | The value for the authorization header passed when making requests to the Xbox Live API. | 
            is_valid
  
      property
  
    Whether the player's Spartan token is still valid.
              AzureApp(client_id, client_secret, redirect_uri='https://localhost')
  
      dataclass
  
    An Azure Active Directory (Azure AD) application.
Azure AD is a cloud-based identity and access management service from Microsoft. It allows you to sign in and access Microsoft resources from an application.
Attributes:
| Name | Type | Description | 
|---|---|---|
| client_id | str | The client ID of the application. | 
| client_secret | str | The client secret of the application. | 
| redirect_uri | str | The redirect URI of the application. Defaults to "https://localhost". | 
              ClearanceToken(raw)
  
      dataclass
  
    A Halo Infinite clearance token response.
A clearance token is required for some API endpoints.
Attributes:
| Name | Type | Description | 
|---|---|---|
| raw | dict[str, Any] | The raw, deserialized JSON response. | 
            token
  
      property
  
    The flight configuration ID.
              SpartanToken(raw)
  
      dataclass
  
    Response resulting from a request for a Spartan token.
This provides the primary means of authenticating with the Halo Infinite API. The tokens are valid for 4 hours.
Attributes:
| Name | Type | Description | 
|---|---|---|
| raw | dict[str, Any] | The raw, deserialized JSON response. | 
            expires_at
  
      property
  
    The UTC datetime at which the Spartan token expires.
            token
  
      property
  
    The spartan token value.
            authenticate_player(session, app)
  
      async
  
    Initial authentication of the app with Windows Live and Xbox Live.
Request an OAuth token and return its refresh token. Save the refresh token for future use.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| session | ClientSession | The session to use for requests. | required | 
| app | AzureApp | The Azure AD application to authenticate. | required | 
Returns:
| Type | Description | 
|---|---|
| str | The OAuth refresh token. | 
            refresh_player_tokens(session, app, oauth_refresh_token)
  
      async
  
    Refresh all tokens and return authenticated player information.
Parameters:
| Name | Type | Description | Default | 
|---|---|---|---|
| session | ClientSession | The session to use for requests. | required | 
| oauth_refresh_token | str | The OAuth refresh token. | required | 
| app | AzureApp | The Azure AD application to authenticate. | required | 
Returns:
| Type | Description | 
|---|---|
| AuthenticatedPlayer | The authenticated player information. |