简体   繁体   English

Laravel 5.7护照返回始终在AWS服务器上未经身份验证

[英]Laravel 5.7 passport return Unauthenticated always on AWS server

I am facing laravel authentication issue. 我面临laravel身份验证问题。 I follow the Laravel 5.7 official docs to handle authentication. 我遵循Laravel 5.7官方文档来处理身份验证。 It works on localhost but when deployed on AWS server, it gives unauthenticate message. 它可以在localhost上运行,但是当部署在AWS服务器上时,它会提供未认证的消息。 Each login time new token generate but Laravel doesn't authenticate it. 每个登录时间都会生成新令牌,但Laravel不会对其进行身份验证。

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... 我不知道是在使用护照还是在使用令牌...但是我认为在本地主机上生成的用于签名令牌的密钥与AWS上的密钥不同...如果您可以手动将密钥迁移到服务器(这是个坏主意)..在AWS上重新生成一个新服务器...如果不够清楚,我还不知道...

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... 要添加到它...密钥通常位于存储目录下(公共和私有...),但最好生成一个新密钥...

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 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 Laravel Passport-/ oauth / token生成无效令牌

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM