Programmatically login to Facebook using username/password Programmatically login to Facebook using username/password curl curl

Programmatically login to Facebook using username/password


I don't believe there is a way to do what you're describing, other than a painful and non-supported method of emulating a user agent. It's also not a good practice to do what you're describing, as Facebook (and other websites for that matter) should not allow 3rd parties to collect usernames/passwords, even if it's only in transit. I understand that in your scenario, you will be the only user, but Facebook has to design their API for the masses.

Why not set up a Facebook App and use oauth? You'll only need to authorize your App once, get an offline access token, and then use that access token from then on. I think this will be easier than the approach you're looking for because you won't need to authenticate with Facebook every time. You just need the access token.

Note that the offline access token will expire if you change your Facebook password or you de-authorize your app.