In the docs, it specifies using the 'Authorization' header to embed the API key as this:
Authorization: api_key LSOSFOFJOWOIEFJ9M7YA
However, in my development I found that I was never receiving the API KEY.
I looked into it and found that in the jBackend Module Request (where the api_key is getting parsed) the "Authorization" header was not found in the incoming headers and therefore the API KEY was never found.
I verified this by adding an "error_log( var_dump($_SERVER)); and then looking at all fields within the $_SERVER. The "Authorization" header was not there.
So I added the following to implement a more standard way of handling the API Key.
file: com_jbackend/models/request.php
// This is the original code. The "Authorization" header was never found here.
if (isset($_SERVER['HTTP_AUTHORIZATION']))
{
$header_auth = explode(' ', $_SERVER['HTTP_AUTHORIZATION']);
if ($header_auth[0] === 'api_key')
$api_key = $header_auth[1];
}
// Note: My addition is here:
else //<--- this is the more STANDARD way to handle the API KEY.
{
// Check API key the standard way ... using the new standard API-KEY
if( isset($_SERVER['HTTP_API_KEY']) )
{
$header_auth = explode(' ', $_SERVER['HTTP_API_KEY']);
$api_key = $header_auth[0];
}
}
So now I use the following header to pass in the API KEY and all is good!
Api-Key: LSOSFOFJOWOIEFJ9M7YA
BTW: Thanks for a GREAT product. Your jBackend has made my development SO much easier! I would highly recommend it!