skip to Main Content

I am facing laravel authentication issue. I follow the Laravel 5.7 official docs to handle authentication. It works on localhost but when deployed on AWS server, it gives unauthenticate message.
Each login time new token generate but Laravel doesn’t authenticate it.

2

Answers


  1. Chosen as BEST ANSWER
    Apache is notorious for stripping the Authorization header. You'll want to verify you 
    have that header in the incoming request.
    Please add this (/etc/apache2/sites-available)
    
    <Directory "/var/www">
    AllowOverride All
    </Directory>
    

    https://askubuntu.com/questions/429869/is-this-a-correct-way-to-enable-htaccess-in-apache-2-4-7

    Laravel Passport - /oauth/token generates invalid token


  2. I don’t know whether are using passport or what you are using for token…
    But i think the keys generated on your localhost for signing the tokens are different from the one on AWS… If you can manually migrate the keys to server (which is a bad idea)..
    The regenerate a new one on the AWS… I don’t if am clear enough…

    To add to it… The key are normally located under the storage dir… (both public and private…) But better to generate a new one instead…

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search