You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This isn't an issue as much as a request for help. I couldn't find a forum where this would be better asked.
I'm using the package under Laravel 4.2.11. I've tried the most basic of examples but am unable to get the auth to do anything. This is a contrived example obviously and I wouldn't actually use POST to get books--I ultimately need to add new rows to a db. Anyway, changing to a GET makes no difference.
I have installed the package, done the migration and generated a key, and verified they exist.
My controller is:
<?php namespace App\Controllers;
use Chrisbjr\ApiGuard\Controllers\ApiGuardController;
use Response;
use Storage\Book\BookRepository as Book;
class BookController extends ApiGuardController {
protected $book;
public function __construct(
Book $book
) {
$this->book = $book;
}
public function postUpdateBooks() {
return Response::json($this->book->getBooks());
}
}
$this->book->getBooks() is a call to a model method that returns all books. I'm using the Response class as discussed in #19.
I then try this using curl (also using Postman):
curl -X POST https://localdev.com/api/v1/books
Rather than trigger an auth error, I get the books JSON return. If I add an incorrect X-Authorization token, I still get the books JSON. My understanding is all methods automatically have keyAuthentication enabled, but I still tried adding the protected $apiMethods property and set it to true. Still no auth.
I'm getting no errors and the api_logs table is empty. I'd appreciate any pointers.
The text was updated successfully, but these errors were encountered:
This isn't an issue as much as a request for help. I couldn't find a forum where this would be better asked.
I'm using the package under Laravel 4.2.11. I've tried the most basic of examples but am unable to get the auth to do anything. This is a contrived example obviously and I wouldn't actually use
POST
to get books--I ultimately need to add new rows to a db. Anyway, changing to aGET
makes no difference.I have installed the package, done the migration and generated a key, and verified they exist.
My controller is:
$this->book->getBooks()
is a call to a model method that returns all books. I'm using theResponse
class as discussed in #19.I then try this using curl (also using Postman):
Rather than trigger an auth error, I get the books JSON return. If I add an incorrect
X-Authorization
token, I still get the books JSON. My understanding is all methods automatically havekeyAuthentication
enabled, but I still tried adding theprotected $apiMethods
property and set it totrue
. Still no auth.I'm getting no errors and the
api_logs
table is empty. I'd appreciate any pointers.The text was updated successfully, but these errors were encountered: