Skip to content

Functions

Anôncer edited this page Aug 15, 2022 · 2 revisions

To use the Steam Guard functions, we need to read the session (linker.LinkedAccount) file "accountName.maFile" we wrote in this STEP.

string sgFile = JsonConvert.SerializeObject(linker.LinkedAccount, Formatting.Indented);

//linker.LinkedAccount.AccountName -- return string name account
//File extension optional ".maFile"
string fileName = linker.LinkedAccount.AccountName + ".maFile";
File.WriteAllText(fileName, sgFile);

Load Session

We will use Newtonsoft.Json to turn from text into class SteamGuardAccount

//Read all Text File
string content = File.ReadAllText(fileName);

//Deserialize content from file
SteamGuardAccount Guard = JsonConvert.DeserializeObject<SteamGuardAccount>(content);

The SteamGuardAccount class is used to work with Steam Guard. All further actions will be performed in this class.

Functions List

Function Names Arguments Result Description
DeactivateAuthenticator int scheme = 2 bool Removes the Steam authenticator from the user's account. (You will need to delete the session file)
GenerateSteamGuardCode string Generates a secret code for Steam. Returns generated code
GenerateSteamGuardCodeForTime long time string
FetchConfirmations Confirmation[]
FetchConfirmationsAsync Task<Confirmation[]>
GetConfirmationTradeOfferID Confirmation conf long
AcceptMultipleConfirmations Confirmation[] confs bool
DenyMultipleConfirmations Confirmation[] confs bool
AcceptConfirmation Confirmation conf bool
DenyConfirmation Confirmation conf bool
RefreshSession bool
RefreshSessionAsync Task<bool>
GenerateConfirmationURL string tag = "conf" string
GenerateConfirmationQueryParams string tag string
GenerateConfirmationQueryParamsAsNVC string tag NameValueCollection

DeactivateAuthenticator

Removes the Steam authenticator from the user's account. (You will need to delete the session file)

bool answer = Guard.DeactivateAuthenticator();

//If the authenticator is deleted, then delete the file with the session
if(answer)
     File.Delete(fileName);

GenerateSteamGuardCode

Generates a secret code for Steam. Returns generated code

string code = Guard.GenerateSteamGuardCode();
Console.WriteLine(code);
Clone this wiki locally