Support the ongoing development of Laravel.io →
Authentication Requests
Last updated 2 years ago.
0

Hi,

I never did this so maybe somebody will have a better answer.

But i know you can check the origin of the request in the headers.

$request->header('origin');

Then check if secret key match domain.

Last updated 9 years ago.
0

Origin returns me a null. API key unique but user can use that key in many sites, so I want disable it option.

0

My bad it's not origin, try with

$request->header('Host');

You can check headers in chrome inspector, look at a javascript request for example ;)

Last updated 9 years ago.
0

It returns me a API url. Maybe it helps, I call curl on this way:

$query['appkey'] = 'some lenght key';
$str = '';
foreach($query as $k => $v)
     $str .= $k.'='.$v.'&';
$ch = curl_init();
$url = "http://apiwebsite/api/data?"; . $str;
curl_setopt($ch, CURLOPT_URL, $url);
curl_exec($ch);
curl_close($ch);
Last updated 9 years ago.
0

Hmmm,

did you tried with

$request->header('referer');
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.