Hi, everybody! No ideas ?
Invalid credentials. Auth.basic fails (laravel 5.5)
Hello! I'm trying to create simple http basic authentication. For this I use the example given on the official website - https://laravel.com/docs/5.5/authentication
I created route
Route::post('api/post')->middleware('auth.basic');
At the outset, the error was due to the lack of a csrf_token, I added it, but... don't working(
i have error - The page has expired due to inactivity. Please refresh and try again
OK, I fixed this problem by adding a router to an exception, but i see new problem - Invalid credentials..
I don't understand what i do wrong
this is simple code API curl:
curl_setopt($ch, CURLOPT_URL, 'http://server.io/api/post');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch,CURLOPT_POSTFIELDS, $params);
Where is params =
$params = [
'email'=>'[email protected]',
'password'=>'[email protected]',
'_token'=>csrf_token(),
];
I can not understand how I can debug these errors, it's simple authentication without customization ...
I tested the standard authentication of Laravel, it does not work either ...
I'm working in a local environment: OpenServer (PHP 7.1, Apache + Nginx x64, MySQL 5.6, Redis 3.2)
Thanks!
Yes, I understand this and I do according to the documentation. The password is transmitted correctly.
I solved the problem by reinstalling laravel.
I do not know what the problem was, but basic authentication from the box did not work when the project was first installed
Please or to participate in this conversation.