-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Can't get Basic Auth to work #325
Comments
Can you login using the same credentials with a simple |
I can successfully authenticate using |
Hi @Ortix92, I experienced the same thing. How does your webserver configuration look like? It might be that the authorization headers are not sent. I'm using Apache and had to add the following for this to work
|
I'm using nginx and php-fpm. The auth headers are sent when using the regular laravel basic auth. But as soon as dingo comes into play it breaks down. Weird.. |
How do your routes look like? |
Hi, I have the same problem, i am using dingo with jwt-auth. Always got: {"message":"Failed to authenticate because of bad credentials or an invalid authorization header.","status_code":401} Route: Route::api(['version' => 'v1', 'after'=>'cors'], function() {
Route::group(['prefix' => 'account', 'protected' => true, 'providers' =>'jwt'], function() {
Route::post('/login', ['protected' => false, 'uses' => 'UserController@login']);
Route::get('/test_credentials', 'UserController@test_credentials');
});
}); And i added: Authorization: Bearer {token} in http header. what i am doing here is
|
@ruanyl This might be the same issue as yours tymondesigns/jwt-auth#16 |
@tymondesigns Yeah! I got it solved 😄 Thank you for the information! |
Hi @Ortix92, You might want to add the following to your .htaccess file:
As mentioned also by everybody here, the http headers are not set and the above will correct that. Sacha |
Sounds like this is resolved? I shall close it then. Cheers to all who helped. |
It turned out to be this line in the config:
I had no idea it was defaulting on email.. In the documentation it's inferred that the default value can be changed to, for example, email. |
Good to hear @Ortix92! I remember now I also changed that setting :) |
'auth' => [ |
It should add below to ***.conf
But add this to .htaccess don't work |
I did all ways that described but none of them does not work and when sent requests to protected endpoint |
add this to your config/api.php
|
I'm having some troubles with the authentication layer. No matter what I try, I can not use the laravel 4.2 basic auth functionality.
I protected my route in the constructor and this is the response after making a post request with postman:
{"message":"Invalid authentication credentials.","status_code":401}
I'm using
0.8.2
The text was updated successfully, but these errors were encountered: