quer / the-steam-awards

Steam multi account module/event (get updates when event for steam)
94 stars 13 forks source link

Modules do not work, as steam change login flow. so web cookies do not work!.. #70

Open quer opened 9 months ago

quer commented 9 months ago

so steam change the login flow. So currently, the hole project, do not work!

Im looking into it. ASF have solved it. i do see how, But it done here: https://github.com/JustArchiNET/ArchiSteamFarm/commit/d571cd9580f6ac1f2cdb43b96af1e33430801bc8?diff=unified

If you have any knowledge on this. do take contact to me!.

you might read more here: https://github.com/JustArchiNET/ArchiSteamFarm/issues/3043

HenkerX64 commented 9 months ago

Check how is working "steam-session" package

HenkerX64 commented 9 months ago

I checked our solution from this summer sale and it works fine. @SENPAY98K, probably can help you

quer commented 9 months ago

Hey! So that do still work? then i will have a look, how it setup

HenkerX64 commented 9 months ago

hmm, I am not sure now, I tested only login from last refresh token

quer commented 9 months ago

The way i get the session/cookies to day, is when you are login to steam the socket, it provie a "key" ( webapi_authenticate_user_nonce ) , that can be used to sign direct into steam.

i am reading into the "steam-session", That is just working as you sing into the phone, and get the cookies like that. Im not toral sure, but im look into it.

if you are using it , can i get you to conferm that the cookies work.

quer commented 8 months ago

I have found a solution for the new login flow. Im working on adding it to the core of this project.

so it shoud be added to day, or tomorrow.

quer commented 8 months ago

It almost ready, But do not work fully yet. No sure why. i have a proof of concept, that work as it shoud.

Rest is just the proof of concept. to ensure i don't lose it:

var webCookies = []; 
webCookies.push("sessionid=xxxxxxxxx");
webCookies.push("steamLoginSecure=xxxxxxxxx");

const request = require('request');
var defaultTimeout = 30000;
var requestWrapper1 = request.defaults({
    timeout: defaultTimeout
});
var jar = request.jar();
var request2 = requestWrapper1.defaults({jar: jar});
webCookies.forEach(cookie => {
    jar.setCookie(request.cookie(cookie), "https://store.steampowered.com");
    jar.setCookie(request.cookie(cookie), "https://steamcommunity.com");
    jar.setCookie(request.cookie(cookie), "https://checkout.steampowered.com");
});
JoinGroup("https://steamcommunity.com/groups/156as8464w3").then(function () {
    console.log("done!");
})
function JoinGroup(groupUrl) {
    return new Promise(function (resolve, reject) {
        request2.post({
            url: groupUrl,
            form:{
                sessionID: sessionID,
                action: "join"
            },
            json: true
        }, function (error, response, body) {
            if(error){
                reject(error);
                return
            }
            resolve();
        });
    })
}

the above will join the group, but i have tryed to mirror it in the project. by: https://github.com/quer/the-steam-awards/blob/70-modules-do-not-work-as-steam-change-login-flow-so-web-cookies-do-not-work/lib/request.js#L23C19-L23C19 then in the test module, just call the post direct, like in the example https://github.com/quer/the-steam-awards/blob/70-modules-do-not-work-as-steam-change-login-flow-so-web-cookies-do-not-work/modules/testing/test.js#L14C28-L14C28