PHP CloudFlare Login

386 views Asked by At

I've tried countless times to make a PHP script that auto logins to my CloudFlare account only with some success. I did make a script that logins but does not show the contents of page after the login. Is it possible to do this?

1

There are 1 answers

0
mjsa On

As CloudFlare has CSRF protection (as you would expect!) you cannot merely just send a post request to their login endpoint.

I have done this by means of a Chrome of a extension. Essentially I wrote a bit of Javascript that would get from a PHP script, the username and password to pass into CloudFlare from a PHP script after doing an AJA request. It then populates the field and submits the request (checking the referrer isn't login endpoint, preventing an infinite loop if the login details are wrong).

I hope this is useful.