Overview
Authentication commands handle both Minecraft account authentication (Microsoft and Offline) and LiquidBounce account authentication. These commands are defined insrc-tauri/src/app/gui/commands/auth.rs.
Minecraft Authentication
login_offline
Create an offline Minecraft account with a username. This generates a UUID using the same algorithm as Minecraft servers.The Minecraft username for the offline account. Can be any string.
An offline Minecraft account object
The UUID generation algorithm matches Minecraft’s offline mode:
login_microsoft
Authenticate with a Microsoft account to create a premium Minecraft account. This initiates the Microsoft device code flow.The Tauri window instance (automatically passed by Tauri)
A premium Microsoft-authenticated Minecraft account
microsoft_code- Emitted with the device code string that the user needs to enter at microsoft.com/devicelogin
refresh
Refresh the authentication tokens for a Microsoft account. This checks if tokens are expired and renews them if necessary.The Minecraft account to refresh. Can be any type, but only Microsoft accounts are actually refreshed.
The refreshed account with updated tokens
- For Premium accounts: Refreshes Microsoft, Xbox Live, and Minecraft tokens if expired
- For LegacyMsa accounts: Refreshes and upgrades to Premium format
- For Offline accounts: Returns the account unchanged
logout
Logout from a Minecraft account. Currently performs cleanup operations.The Minecraft account to logout from
Returns nothing on success
LiquidBounce Authentication
client_account_authenticate
Authenticate with a LiquidBounce account using OAuth2 flow.The LiquidBounce API client instance
The authenticated LiquidBounce account with user information
This command automatically opens the OAuth2 authorization URL in the user’s default browser.
client_account_update
Update and refresh a LiquidBounce account’s access token and user information.The LiquidBounce API client instance
The current LiquidBounce account to update
The updated account with fresh tokens and user information
This command performs two operations:
- Renews the OAuth2 access token using the refresh token
- Fetches updated user information from the API
Error Handling
All authentication commands returnResult<T, String>, which means they can fail with descriptive error messages:
Source Code
Location:src-tauri/src/app/gui/commands/auth.rs:1
Key dependencies:
azalea_auth- Microsoft authentication librarycrate::auth::ClientAccount- LiquidBounce account typescrate::minecraft::auth::MinecraftAccount- Minecraft account types