The Steam Token Login script is a Python utility designed to facilitate logging into a Steam account using a provided authentication token. It automates the process of configuring Steam's local configuration files to authenticate a user without requiring manual password entry. The script interacts with the Windows registry to locate the Steam installation, decodes the provided token, and sets up necessary configuration files in Steam's userdata and config directories.
Note: This script is intended for educational purposes and should be used responsibly and in compliance with Steam's terms of service. Unauthorized use of tokens or account access may violate Steam's policies and applicable laws.
- Token-based Authentication: Logs into a Steam account using a provided authentication token.
- Registry Integration: Automatically detects the Steam installation path via the Windows registry.
- Configuration File Management: Creates and updates Steam configuration files (
localconfig.vdf,config.vdf,loginusers.vdf, andlocal.vdf) to enable login. - SteamID Conversion: Supports multiple SteamID formats (SteamID, SteamID3, SteamID32, SteamID64) using the
SteamIDclass. - Process Management: Terminates running Steam processes to ensure clean configuration updates.
- Token Validation: Validates and decodes JWT tokens, handling encoding errors gracefully.
- Encrypted Storage: Stores the token securely using Windows'
CryptProtectDatafor local storage.
- Operating System: Windows (due to reliance on
winregandwin32crypt). - Python Version: Python 3.6 or higher.
- Required Libraries:
winreg(built-in)pathlib(built-in)vdf(for parsing and writing Valve Data Format files)jwt(for decoding JSON Web Tokens)win32crypt(viapywin32for Windows encryption)binascii(built-in)zlib(built-in)
- Steam Installation: A valid Steam client installation on the system.
- Administrator Privileges: May be required to terminate Steam processes and write to certain directories.
-
Run the script using Python:
python login_steam.py
-
When prompted, enter the Steam authentication token in the format
<login>.<token_part>.- Example:
username.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... - The token must include a valid JWT with a
subfield containing the SteamID.
- Example:
-
The script will:
- Locate the Steam installation directory.
- Terminate running Steam processes.
- Decode the token to extract the SteamID.
- Create or update necessary configuration files in the Steam directory.
- Launch Steam with the configured login.
-
Press Enter to exit the script after completion.
login_steam.py: Main script containing the token login logic and SteamID conversion class.README.md: This documentation file.requirements.txt: List of required Python packages.
- Token Input: The user provides a token in the format
<login>.<token_part>. - Steam Path Detection: The script queries the Windows registry (
HKEY_CURRENT_USER\Software\Valve\Steam) to find the Steam installation path. - Token Validation and Decoding:
- Validates the token format (allowed characters: A-Z, a-z, 0-9, -, _, ., =).
- Decodes the JWT token to extract the SteamID (
subfield). - Handles encoding errors (UTF-8 and Windows-1251 fallback).
- SteamID Conversion: Uses the
SteamIDclass to convert the provided SteamID into SteamID32 format for directory creation. - Process Termination: Kills Steam-related processes (
Steam.exe,steamwebhelper.exe,steamservice.exe) to prevent file access conflicts. - Configuration Setup:
- Creates the user's configuration directory (
userdata\<SteamID32>\config). - Writes
localconfig.vdfto disable streaming and friends sign-in. - Updates
config.vdfandloginusers.vdfin the Steam config directory with account details. - Stores the encrypted token in
%LOCALAPPDATA%\Steam\local.vdfusingCryptProtectData.
- Creates the user's configuration directory (
- Steam Launch: Starts Steam using the
steam://0protocol. - Error Handling: Provides detailed error messages for invalid tokens, missing Steam installations, or other issues.
The SteamID class handles conversion between different SteamID formats:
- Input: Accepts SteamID (e.g.,
STEAM_0:1:123456), SteamID3 (e.g.,U:1:123456), SteamID32, or SteamID64. - Methods:
get_steam64_id(): Returns the 64-bit SteamID.get_steam32_id(): Returns the 32-bit SteamID.get_steam_id3(): Returns the SteamID3 format.get_steam_id(): Returns the traditional SteamID format.
- Error Handling: Raises
InvalidSteamIDfor invalid inputs.
A valid token might look like:
johndoe.eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI3NjU2MTE5Nzk2MDI2NTcyOCIsImV4cCI6MTcyOTM4NzIwMH0.SIGNATURE
johndoe: The Steam account login name.eyJhb...: The JWT token containing the SteamID in thesubfield.
- Windows Only: Relies on Windows-specific libraries (
winreg,win32crypt). - Token Dependency: Requires a valid JWT token with a
subfield. - Steam Terms of Service: Using tokens to access accounts may violate Steam's policies. Use with caution.
- No macOS/Linux Support: The script is not compatible with non-Windows systems due to registry and encryption dependencies.
- "Steam directory not found": Ensure Steam is installed and has been run at least once to create registry entries.
- "Invalid token format": Check that the token contains only allowed characters and includes a
.separator. - "Decoded token does not contain 'sub' key": Verify that the JWT token includes a valid SteamID in the
subfield. - Permission Issues: Run the script as an administrator if Steam processes cannot be terminated or files cannot be written.
This script is provided for educational purposes only. The author is not responsible for any misuse or violation of Steam's terms of service. Use at your own risk.