1

i need help i've been trying to run this

curl -H "Authorization: Basic dXNlckBjb21wYW55LmNvbTp0ZXN0" https://security.voluum.com/login

but quite stuck, also is it possible to create this in php or in json? i need data to create something. also i tried replacing dXNlckBjb21wYW55LmNvbTp0ZXN0 with my own 64bit username:pass but still not working can someone explain this i really dont know what to do

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Jan Aranas
  • 67
  • 5
  • You could read documentation on CURL, read the PHP manual on CURL, search for other topics on StackOverflow to see if other uses also encountered this issue. – Cagy79 Nov 25 '16 at 13:04

1 Answers1

1

In your case data for login is: user@company.com:test. And you can use curl in ssh like follows:

curl -u user@company.com:test https://security.voluum.com/login

PHP

You can also execute this in PHP as follows:

$user='user@company.com';
$pass='test';
$url='https://security.voluum.com/login';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$user:$pass");
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);   //get status code
$result=curl_exec($ch);
curl_close($ch);
echo "Status code: $status_code \n";
print_r($result);

More informations

Base64

dXNlckBjb21wYW55LmNvbTp0ZXN0 == user@company.com:test you can decode/encode it by yourself here

Curl

More about -u you can read here. And curl manual is available here

PHP

PHP:Curl Manual

Community
  • 1
  • 1
Karol Gasienica
  • 2,825
  • 24
  • 36