File: rest-login.php
Source Location: /pearweb_index-1.16.13/public_html/rest-login.php
Classes:
Page Details:
Simple REST-based server for remote authentication
To access, first browse to rest-login.php/getsalt and retrieve a salt plus the session idea from the HTTP response headers. Then, use the salt to create a new hash of the hashed password and send a POST request to rest-login.php/validate and the response will be returned in plain text. If the first character returned is "8" then the login succeeded. 1-6 are internal errors, 0 and 7 are invalid logins. Here is some sample code for a client to access this server: <?php
$user = 'username';
$password = 'password';
preg_match('/PHPSESSID=(.+); /', $cookies[0 ], $session);
$pass = md5($salt . md5($password));
$opts = array('http' => array(
'method' => 'POST',
'header' => 'Cookie: PHPSESSID=' . $session[1] . ';',
));
?>
Documentation generated on Mon, 11 Mar 2019 15:14:36 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|