0

So I want to have authentication via HTTP Basic Auth --and-- authentication which accepts a username / password via HTML. I also want the username / password combo to be different for each one. To that end I figured I'd use the following pre-built middleware:

  • Illuminate/Auth/Middleware/Authenticate
  • Illuminate/Auth/Middleware/AuthenticateWithBasicAuth

My question is... can I use both regular authentication authentication and HTTP Basic authentication at the same time whilst having a different username / password combo for both?

neubert
  • 15,947
  • 24
  • 120
  • 212
  • Have you tried it? Should be pretty quick to just enable both middleware and see if it works. Your users are going to love you. – miken32 Jan 26 '21 at 23:25

2 Answers2

1

Your question may be solved using multiauth and Laravel Passport, see here for more info:

how to implement multiauth in laravel passport

Lewis Smith
  • 1,271
  • 1
  • 14
  • 39
0

https://medium.com/oceanize-geeks/laravel-middleware-basic-auth-implementation-88b777361b5c pointed me in the necessary direction. Basically, per that tutorial, Illuminate/Auth/Middleware/AuthenticateWithBasicAuth was not used. A new from-scratch middleware was created and then added to app/Http/Kernel.php

neubert
  • 15,947
  • 24
  • 120
  • 212
  • You should extract the instructions from the linked aricle in case the viewer of the answer cannot access medium or the original author deletes the post. – darryn.ten Jan 10 '23 at 13:34