Reputation: 24116
At the moment, when I add a before
filter to my route like this:
Route::get('/', function() {
return View::make('front');
})->before('auth.basic');
and visit my test app (e.g. http://domain.com), I see the following in Chrome:
What I'd like to is; when the user enters the username and password and clicks the "Login In" button - run a custom credential validation routine to verify the entered details.
By custom validation routine, I mean to make a request to external API and check if entered credentials are valid and then return true
/false
to the basic auth attempt.
Is this possible? Does this involve writing a custom auth.basic
driver?
Upvotes: 0
Views: 260
Reputation: 927
While using auth.basic
authentication in laravel, it uses the HTTP basic authentication for the website, meaning that it asks and appends username and password in the HTTP header of the packets. Saying that, browsers are prepared to take care of HTTP basic authentication and does it before processing the body of the packet, meaning that you see the pop-up shown.
use laravel's auth
instead. It checks if the user is already logged in by the registered Auth::check()
in session, and if not, redirects to your login url and stores the intended url in session to redirect after authentication is passed. See Laravel Documentation.
Upvotes: 1