SteamAuth C# Library

repository·master·Indexed 43 days ago

https://github.com/geel9/steamauth

A C# library for programmatic access to Steam Mobile Authenticator functionality, including generating Steam Guard login codes, linking and activating new authenticators, and managing mobile confirmations.

Tokens
584
Snippets
2
Records
4
Agent score
6%

What's inside SteamAuth

  1. Link and activate a new mobile authenticator

    master

    To add a mobile authenticator to a Steam account, follow these steps:

    1. Use UserLogin to log into the target account.
    2. Instantiate an AuthenticatorLinker.
    3. Call AuthenticatorLinker.AddAuthenticator().
    4. CRITICAL: Immediately after calling AddAuthenticator(), but before calling FinalizeAddAuthenticator(), you must save the JSON string of AuthenticatorLinker.LinkedAccount. This object contains the necessary data to generate future codes. Failure to save this data will result in being locked out of the account.
    5. Call AuthenticatorLinker.FinalizeAddAuthenticator() to complete the process.
    // 1. Login
    var login = new UserLogin();
    // ... perform login logic ...
    
    // 2. Link Authenticator
    var linker = new AuthenticatorLinker();
    linker.AddAuthenticator();
    
    // 3. CRITICAL: Save the LinkedAccount JSON now!
    string importantData = linker.LinkedAccount; // Save this string to a database/file
    
    // 4. Finalize
    linker.FinalizeAddAuthenticator();
  2. Generate Steam Guard login codes

    master

    If you already possess a SharedSecret, you can generate login codes by instantiating a SteamGuardAccount and assigning the secret to its SharedSecret property. Use the GenerateSteamGuardCode() method to produce the current code.

    var account = new SteamGuardAccount();
    account.SharedSecret = "YOUR_SHARED_SECRET";
    string code = account.GenerateSteamGuardCode();
  3. Manage mobile confirmations

    master

    You can interact with pending mobile confirmations using a SteamGuardAccount instance:

    • Fetch pending confirmations: Call SteamGuardAccount.FetchConfirmations().
    • Accept a confirmation: Call SteamGuardAccount.AcceptConfirmation.
    • Deny a confirmation: Call SteamGuardAccount.DenyConfirmation.