Support the ongoing development of Laravel.io →
Authentication Database Eloquent
Last updated 1 year ago.
0

Can you show those routes?

Did you create a password on your local server and set the same value in the production database? Does the local server and the production server have the same key? (app.php)

Last updated 1 year ago.
0

stefandroog said:

Can you show those routes?

Did you create a password on your local server and set the same value in the production database? Does the local server and the production server have the same key? (app.php)

ah! damn it...I totally forgot about key in app.php...I didn't even generate a key yet...it's still

'key' => 'YourSecretKey!!!',

is this the problem?

Edit:

Weird...I went app.php and clear out that 'YourSecretKEY!!' and went to command line and used php artisan key:generate which it generated and said success BUT when I go into the app.php file the key is '' I ended up typing in the keys myself a 32character keys. and uploaded into the server. Still no luck :(

Last updated 1 year ago.
0

By default you should use 'email' instead of 'username' or did you change that?

How do you authenticate your user? Can you show that part of the controller as well?

Last updated 1 year ago.
0

stefandroog said:

By default you should use 'email' instead of 'username' or did you change that?

How do you authenticate your user? Can you show that part of the controller as well?

and yup I did change the basic auth filter to 'username'

oops I thought for basic authenticate you don't need to do anything in the controller. Am I missing something here? I was watching videos about basic auth and seems it works locally even without anything in controller though.

Last updated 1 year ago.
0

Did you cleared the cookies and regenerated the password for the user in db after changed the key?

Edit: Also try look into the request server params. You can access the given user trough the app('request')->getUser() method and password with ->getPassword(). You can look at $_SERVER or app('request')->server for PHP_AUTH_USER and PHP_AUTH_PW. If they are not present it most likely some server/php configuration issue, what I can find this happens if remote auth and safe-mode is enabled (safe-mode is deprecated with php 5.3.x and removed in 5.4).

Last updated 1 year ago.
0

tlgreg said:

Did you cleared the cookies and regenerated the password for the user in db after changed the key?

Edit: Also try look into the request server params. You can access the given user trough the app('request')->getUser() method and password with ->getPassword(). You can look at $_SERVER or app('request')->server for PHP_AUTH_USER and PHP_AUTH_PW. If they are not present it most likely some server/php configuration issue, what I can find this happens if remote auth and safe-mode is enabled (safe-mode is deprecated under 5.3.x).

oh I didn't try regenerate the username / password after changed the key. Let me try it in a day or two

hummm...trying to digest the server params you are talking about I am still really new with this kind of stuff...

Last updated 1 year ago.
0

The process mentioned in the following link helped me (might help you guys too if the core of the problem is same) - http://codetheory.in/fixing-laravel-basic-auth-failure/

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

et4891 et4891 Joined 14 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.