Steam Authenticator
A Python-based Steam Guard authenticator that generates time-based one-time passwords (TOTP) and manages trade confirmations for multiple Steam accounts.
Features
- Generate Steam Guard codes for multiple accounts simultaneously
- Real-time code generation with countdown timer
- Automatic token refresh when expired
- Trade confirmation management (approve/deny)
- Support for multiple account types (trades, market listings, etc.)
- Cross-platform support (Windows, macOS, Linux)
Requirements
- Python 3.7+
- Dependencies listed in
requirements.txt
Installation
- Clone the repository:
git clone https://github.com/yourusername/SteamAuthenticator.git
cd SteamAuthenticator
- Install required dependencies:
pip install -r requirements.txt
- Create a
maFiles directory in the project root:
mkdir maFiles
- Add your Steam Guard
.maFile files to the maFiles directory. These files should be named with your Steam ID (e.g., 76561199059431362.maFile).
Usage
Quick Start
Run the main authenticator:
python SteamGuard.py
If no accounts are configured, you’ll be prompted to add one automatically.
Main Interface
The authenticator displays:
- Account username and Steam ID
- Current Steam Guard code (refreshes every 30 seconds)
- Progress bar showing time until next code
- Remaining seconds
Available Commands:
- Press
Ctrl+C to exit
- Type
2 + Enter to add a new account
- Type
3 + Enter to manage trade confirmations
Add New Account
You can add accounts in two ways:
Option 1: From the main interface
- Run
python SteamGuard.py
- Type
2 and press Enter
- Follow the setup wizard
Option 2: Run the script directly
python add_account.py
Setup Process:
- Enter your Steam username and password
- If Email Steam Guard is enabled, you’ll be guided to disable it first
- Write down your revocation code (CRITICAL - save this!)
- Verify you saved the revocation code
- Enter the SMS code sent to your phone
- Account is added and ready to use
Requirements:
- Account must NOT already have Mobile Authenticator enabled
- Must disable Email Steam Guard if enabled (script will guide you)
- Access to phone for SMS verification
- Valid Steam credentials
Manage Trade Confirmations
While the authenticator is running, type 3 and press Enter to access confirmations:
- View all pending confirmations across accounts
- Approve or deny individual confirmations
- Approve or deny all confirmations at once
- See verification codes for trade safety
Refresh Account Tokens
To manually refresh expired tokens for all accounts:
python refresh_all_accounts.py
This script will:
- Check token expiration status for each account
- Automatically refresh expired tokens using stored credentials
- Update
.maFile files with new tokens
Configuration
Edit the credentials_map dictionary in refresh_all_accounts.py to add your account credentials:
credentials_map = {
'username1': ('username1', 'password1'),
'username2': ('username2', 'password2'),
}
Security Considerations
- Keep your
.maFile files secure and never commit them to version control
- The
maFiles directory is included in .gitignore by default
- Store credentials securely and consider using environment variables for sensitive data
- This tool requires your Steam credentials for token refresh functionality
Project Structure
SteamAuthenticator/
├── SteamGuard.py # Main authenticator script
├── add_account.py # Add new account with authenticator
├── refresh_all_accounts.py # Token refresh utility
├── requirements.txt # Python dependencies
├── maFiles/ # Directory for .maFile files (not tracked)
└── README.md # This file
How It Works
The authenticator uses the Steam Web API to:
- Sync with Steam servers for accurate time
- Generate TOTP codes using HMAC-SHA1 algorithm
- Manage authentication sessions with JWT tokens
- Handle trade confirmations through Steam Community API
Troubleshooting
Token Expired Errors
If you see token expiration errors, run the refresh script:
python refresh_all_accounts.py
No Codes Displayed
Ensure your .maFile files are properly formatted and located in the maFiles directory.
Email Steam Guard Conflict
If you get an error about Email Steam Guard being enabled:
- Go to https://store.steampowered.com/twofactor/manage
- Look for “Login Confirmation” or “Confirmación de inicio de sesión”
- Click “Remove Security Method” or “Eliminar método de seguridad”
- Confirm the removal
- Run the add account script again
SMS Code Not Working
- Make sure you’re entering the code quickly (they expire)
- The code should be 5 digits
- If it fails, wait for a new SMS and try again
- Check that your phone number is correct on your Steam account
Cannot Add Account
Common issues:
- Account already has authenticator: Remove it first at https://store.steampowered.com/twofactor/manage
- Email Steam Guard enabled: Follow the steps above to disable it
- Wrong credentials: Double-check your username and password
- Rate limited: Wait a few minutes and try again
评论