mqwerty Posted July 30 Report Posted July 30 Good afternoon. I am trying to make authorisation in steam from browser. I've encountered the following problem. Steam for some reason responds strangely to my request Quote { "response": { "interval": 5, "extended_error_message": "" } } . While sometimes I get correct data with client_id, request_id, etc. My request looks like this Maybe I don't know some nuances of this api? Quote
Dr. McKay Posted July 31 Report Posted July 31 You should not be sending this stuff in the query string; it needs to go in a POST body. Quote
mqwerty Posted July 31 Author Report Posted July 31 I moved all the data into the body of the query. But now I see an empty response. Quote { "response": { } } Quote
mqwerty Posted July 31 Author Report Posted July 31 It's strange because sometimes it was successful, I think I should check the password encryption process. Thank you! Quote
mqwerty Posted August 2 Author Report Posted August 2 Hello again! I still can't find the problem for myself. I decided to reproduce your encryption method from steam-session but I still see in heders Quote x-eresult:5 import {hex2b64, Key as RSAKey} from 'node-bignumber'; getRSAKey = async (username) => { const result = await fetch(`https://api.steampowered.com/IAuthenticationService/GetPasswordRSAPublicKey/v1/?account_name=${username}/`, { method: 'GET', }) const {response} = await result.json(); return response; } encryptPassword = (password, rsaInfo) => { let key = new RSAKey(); key.setPublic(rsaInfo.publickey_mod, rsaInfo.publickey_exp); return hex2b64(key.encrypt(password)); } startSessionWithCredentials = async (username, password) => { const rsaKey = await getRSAKey(username); const encryptedPassword = encryptPassword(password, rsaKey) const userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36'; const result = await fetch(`https://api.steampowered.com/IAuthenticationService/BeginAuthSessionViaCredentials/v1/`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'user-agent': userAgent, 'origin': 'https://steamcommunity.com', 'referer': 'https://steamcommunity.com' }, body: JSON.stringify({ account_name: username, encrypted_password: encryptedPassword, encryption_timestamp: rsaKey.timestamp, website_id: 'Community', device_friendly_name: userAgent, platform_type: 2 }) }); console.log(await result.json()) } The login and password I enter are exactly valid. The login passes through steam-session. I don't understand what is wrong with my code? Quote
Dr. McKay Posted August 3 Report Posted August 3 Why do you have a stray / at the end of your GetPasswordRSAPublicKey request? It's probably interpreting that as part of the account name. Quote
mqwerty Posted August 5 Author Report Posted August 5 Yes, it was clearly a mistake. But after removing it, the result is still the same, I still see the error. Quote
Recommended Posts
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.