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?

1
  • 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. Commented Jan 26, 2021 at 23:25

2 Answers 2

1

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

how to implement multiauth in laravel passport

Sign up to request clarification or add additional context in comments.

Comments

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

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.