Jump to content
McKay Development

How can I skip the Steam Guard Code: step when logging in using the machineAuthToken.txt file after I have already logged in with an email verification code?


Patrick

Recommended Posts

How can I skip the Steam Guard Code: step when logging in using the machineAuthToken.txt file after I have already logged in with an email verification code?

I don't know if this is possible because I am new to js, if I have got a txt file, how can I use this file to skip the steam guard code step? It is too troublesome to have to enter the email verification code every time

 

Link to comment
Share on other sites

https://github.com/DoctorMcKay/node-steam-user#machine-auth-tokens

steam-user will automatically handle saving and using your machine auth token, but if you're running in an environment where persistent storage isn't possible, you can use the machineAuthToken event to save a token somewhere yourself, and then use it again by passing machineAuthToken to logOn().

Link to comment
Share on other sites

On 9/23/2023 at 12:14 PM, Dr. McKay said:

https://github.com/DoctorMcKay/node-steam-user#machine-auth-tokens

steam-user will automatically handle saving and using your machine auth token, but if you're running in an environment where persistent storage isn't possible, you can use the machineAuthToken event to save a token somewhere yourself, and then use it again by passing machineAuthToken to logOn().

Thank you very much for your reply, but I'm still confused because I'm really new to js. I saw it mentioned in git that "By default, steam-user will automatically save your machine auth tokens in your data directory,"so I didn't Don't know what's wrong with me. This is my entire process and I very much hope and thank you if you can answer my doubts:I specified my own data directory and it successfully generated a machineAuthToken.MyaccountName.txt file when I logged in for the first time, but when I ran it repeatedly it still prompted me to enter the steam guard code,So it looks like I don't need to pass the token manually since it's already generated in the folder I specified.

constructor(settings) {
super();

this.settings = settings;
this.busy = false;

this.steamClient = new SteamUser(Object.assign({
promptSteamGuardCode: false,
enablePicsCache: true // Required to check if we own CSGO with ownsApp
}, this.settings.steam_user));

this.csgoClient = new GlobalOffensive(this.steamClient);

// set up event handlers
this.bindEventHandlers();

// Variance to apply so that each bot relogins at different times
const variance = parseInt(Math.random() * 4 * 60 * 1000);

// As of 7/10/2020, GC inspect calls can timeout repeatedly for whatever reason
setInterval(() => {
if (this.csgoClient.haveGCSession) {
this.relogin = true;
this.steamClient.relog();
}
}, 30 * 60 * 1000 + variance);
}

logIn(username, password, auth) {
this.ready = false;

// Save these parameters if we login later
if (arguments.length === 3) {
this.username = username;
this.password = password;
this.auth = auth;
}

winston.info(`Logging in ${this.username}`);

// If there is a steam client, make sure it is disconnected
if (this.steamClient) this.steamClient.logOff();

this.loginData = {
accountName: this.username,
password: this.password,
rememberPassword: true,
};

if (this.auth && this.auth !== '') {
// Check if it is a shared_secret
if (this.auth.length <= 5) this.loginData.authCode = this.auth;
else {
// Generate the code from the shared_secret
winston.debug(`${this.username} Generating TOTP Code from shared_secret`);
this.loginData.twoFactorCode = SteamTotp.getAuthCode(this.auth);
}
}

winston.debug(`${this.username} About to connect`);
this.steamClient.logOn(this.loginData);
}
Link to comment
Share on other sites

7 hours ago, Dr. McKay said:

Are you on 5.0.1? There was a bug in 5.0.0 that prevented those files from being read properly.

i was on 4.28.1,   and when i updated node-globaloffensive from 2.3.0 to 3.0.0 and node-steam-user 4.28.1 to 5.0.1, then restart my index.js, fill the steam guard code one more time and then restart it , it fixed! I do not need to fill the steam guard code again!  But  i'm not sure which one did the  real job  but thank you very much for your generous help! 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...