geel9 / SteamAuth

A C# library that provides vital Steam Mobile Authenticator functionality
MIT License
276 stars 102 forks source link

Cant get valid steamLoginSecure cookie #102

Open salat-23 opened 11 months ago

salat-23 commented 11 months ago

The cookie SteamGuardAccount has and what my browser has are totally different and the first one doesent really work. I triend doing the authentication process using steamkit but my implementation doesent really work when sending requests, although it looks close enough. Maybe I am doing something wrong, because the steam sends code 400 back when I try to use my new steamLoginSecure so that mean that either session id is broken or something else I am not aware of. Any ideas?

Here is part of my code:

        AuthPollResult pollResponse;
        pollResponse = await authSession.PollingWaitForResultAsync();

        var steamId = authSession.SteamID.ConvertToUInt64();

        SessionData sessionData = new SessionData()
        {
            SteamID = steamId,
            OAuthToken = pollResponse.AccessToken,
            SteamLoginSecure = Uri.EscapeDataString($"{steamId}||{pollResponse.AccessToken}"),
        };

        account.Session = sessionData;
        account.FullyEnrolled = true;
        account.RefreshSession();