Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Help logging into a website with LWP::UserAgent

by aitap (Curate)
on May 18, 2014 at 19:32 UTC ( [id://1086540]=note: print w/replies, xml ) Need Help??


in reply to Help logging into a website with LWP::UserAgent

Speaking of the login procedure, DoLogin() seems to ask for an "RSA key" from the server and do the real authentication in another function called OnRSAKeyResponse. So, after you get the key by something like $lwp->post('https://steamcommunity.com/login/getrsakey/', { username => $username, donotcache => time() }) (untested; you may need to decode the answer if it's JSON), you'll need to do something else as described in OnRSAKeyResponse() function somewhere in JavaScript files. RSA-related modules (Crypt::RSA?) might help with this.

Edit: I should also note that this approach will fail after site developers update login interface, because it's not public API which they are required to maintain in a persistent way. Generally, it's wiser so search whether the site you want to use provides an API. Steam Community seems to have one: http://steamcommunity.com/dev. Does it fullfill your needs?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1086540]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2024-04-25 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found