-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
php 7 without user and password #35
Comments
Can you show me the code you are using? |
middleware.php `<?php /*
*/ use Slim\Middleware\JwtAuthentication; $container = $app->getContainer(); //var_dump($container); $container["HttpBasicAuthentication"] = function ($container) { $container["token"] = function ($container) { $container["JwtAuthentication"] = function ($container) { $container["Cors"] = function ($container) { $container["Negotiation"] = function ($container) { $app->add("HttpBasicAuthentication"); $container["cache"] = function ($container) { |
HttpBasicAuthentication.php `<?php /*
*/ namespace Slim\Middleware; use Slim\Middleware\HttpBasicAuthentication\AuthenticatorInterface; use Psr\Http\Message\RequestInterface; class HttpBasicAuthentication
} |
I use this REST client. chrome://restclient/content/restclient.html |
Have you done some changes to the middleware or why did you post this code? |
No i don't change anything in the HttpBasicAuthentication.php |
This is too big and confusing code dump. Can you show minimal code example which reproduces the problem together with example curl request showing the request and response headers. Something like:
|
With curl testing it works fine. I think the REST client for chrome will "remember" de user basic auth, because i have removed it the credentials to test and it send equal. One question: when i try like this i got a warning: |
This is the response HTTP/1.1 201 Created { |
What is in token.php around line 34? It is not part of Basic Auth middleware. |
|
I'm testing your example https://github.com/tuupola/slim-api-skeleton |
Fresh install with
|
Ok. Now it works. I am sending body like this { "data" : ["tareas.all"] } and it's wrong, it has to be only the array ["tareas.all"] Can i ask you what does exactly this piece from middleware.php ?
|
It adds the content negotiation middleware. The README contains quite good explanation what the middleware does. |
When i test a token request without sending user nor password it return a good token.
I i send user with wrong password it returns unauthorized
The text was updated successfully, but these errors were encountered: