Support the ongoing development of →
Authentication Security
Last updated 1 year ago.

The curl parameter "--user" just passes basic auth info in the HTTP request. You can easily use the BasicAuth middleware =>

However I don't think this is the best approach. If you have several servers/services doing requests on your Laravel instance, you should at least use a seperate user for each one. Otherwise if one of your passwords get compromised you have to change credentials on all servers.

A better solution in my opinion would be to use an access (or authentication) token based mechansim or even better certificates (if there are critical data involved). But that really depends on what kind of data you process.


Thanks Marcod

i had added below line in htaccess as mention in above url

RewriteCond %{HTTP:Authorization} ^(.+)$
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

i remove this line and working properly usig auth.basic as middleware


Sign in to participate in this thread!


Your banner here too?

mukeshp004 mukeshp004 Joined 23 Jun 2014


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

Your logo here?

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

© 2023 - All rights reserved.