-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestAuth.php
36 lines (30 loc) · 1.12 KB
/
testAuth.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
$urlSearch = 'http://apixml.josealbea.com/user';
$public_key = hash_hmac("sha256", '1' . '[email protected]' . time() . '557afa6e50b9a', '57b59e43b10aa25');
$headers = [
'PUB: ' . $public_key,
'USEREMAIL: [email protected]',
'APIKEY: 557afa6e50b9a',
];
$userAgent = "Mozilla/5.0";
$referer = 'http://apixml.josealbea.com/username';
// $postFields = [
// 'email' => '[email protected]',
// 'username' => 'user',
// 'password' => 'azerty',
// 'role' => '2',
// ];
// $httpQuery = http_build_query($postFields);
$curlSearch = curl_init($urlSearch);
// curl_setopt($curlSearch, CURLOPT_POST, true);
// curl_setopt($curlSearch, CURLOPT_POSTFIELDS, $httpQuery);
curl_setopt($curlSearch, CURLOPT_HTTPGET, true);
curl_setopt($curlSearch, CURLOPT_FAILONERROR, 1);
curl_setopt($curlSearch, CURLOPT_USERAGENT, $userAgent);
curl_setopt($curlSearch, CURLOPT_REFERER, $referer);
curl_setopt($curlSearch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curlSearch, CURLOPT_RETURNTRANSFER, 1);
$postXML = curl_exec($curlSearch);
header("Content-type: text/xml; charset=utf-8");
echo($postXML);
curl_close($curlSearch);