Jump to content
McKay Development

This refreshToken is not valid for logging in to the Steam client


Recommended Posts

Posted (edited)
Quote
import SteamUser from 'steam-user';
import {LoginSession, EAuthTokenPlatformType} from 'steam-session';
let client = new SteamUser();
let session = new LoginSession(EAuthTokenPlatformType.WebBrowser);
const loginDetails = {
  accountName: "name",
  password: "pass",
  steamGuardCode: "2fa"
}
await session.startWithCredentials(loginDetails); 
session.on('authenticated', async () => {
  const logOnOptions = {
    "refreshToken": session.refreshToken
  };
  client.logOn(logOnOptions);
  client.on('loggedOn', (details) => {
    console.log("Logged into Steam as " + client.steamID.getSteam3RenderedID());
  });
});

What am I doing wrong

Edited by Ryu
Posted

#Logged into Steam
#Error not logged in

I'm trying to log into the bot with username, password and 2fa manually, save the refreshToken and cookies, and reuse them anytime I restart the bot.

client.logOn({"refreshToken": refreshToken });

client.on('loggedOn', async (details) => {
  console.log("Logged into Steam");

  let manager = new TradeOfferManager({
    "steam": client, 
    "domain": "example.com", 
    "language": "en" 
  });

  manager.setCookies(cookies, (err) => {
    manager.getInventoryContents(730, 2, true, (err, inventory) => {
      if (err) {
        console.log(err);
        return;
      }
  
      if (inventory.length == 0) {
        // Inventory empty
        console.log("CS:GO inventory is empty");
        return;
      }
  
      console.log("Found " + inventory.length + " CS:GO items");
    })
  
  })

});

 

Posted

1.PNG

I guess I can not save and reuse the cookies because they expire after a few seconds. So if I understand, I can use refreshToken to log in but I can't create trades?

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...