Tag Archives: Steam

Steam Desktop Authenticator

I made an application for windows that can generate 2FA codes for Steam. Available on github:

https://github.com/manatails/MiniSteamAuthenticator

Usage

MiniSteamAuthenticator accepts Base32 encoded Steam shared secret as used in Aegis or andOTP. You can use steamctl to generate the shared secret. https://github.com/ValvePython/steamctl

  1. Install steamctl

    pip install steamctl

  2. Generate an authentication token using steamctl

    steamctl authenticator add

  3. Export saved authentication token as a QR code

    steamctl authenticator qrcode YOUR_USERNAME

  4. Scan the QR code with an external application. It will be formatted like this:

    otpauth://steam/steamctl:YOUR_USERNAME?secret=XXXXXX&issuer=Steam

  5. Copy the secret value and add it to the configuration .ini file.

Screenshot

 

Getting the SteamID of current user using Steam_API

This is the code I used when integrating ManaGuardian with Steam.
I could not find any other posts regarding this so I am publishing my code for reference. I hope it helps

Steam API header files from valve SDK are required

https://github.com/ValveSoftware/source-sdk-2013/tree/master/sp/src/public/steam

//Initialize Steam API

InitResult irResult = g_oSteamAPI.Initialize(g_szAppPath);

if (irResult != IR_SUCCESS)
    return EXIT_FAILURE;

//Open Steam User Interface
ISteamUser* pSteamUser = g_oSteamAPI.GetSteamUserInterface();

if (!pSteamUser)
    return EXIT_FAILURE;

CSteamID sSteamID = pSteamUser->GetSteamID();
uint64 uSteamID = sSteamID.ConvertToUint64();
char cSteamID[64];
sprintf(cSteamID, "%lld", (long long)uSteamID);
printf("User SteamID : %s\n", cSteamID);

The code is pretty much self-explanatory.