Testing Laravel Passport OAuth2 page does not work: Authentication Required

Last Updated: December 12, 2017


I have OAuth2 server running properly at and I made another Laravel project to test the client application at When I open the client application I am getting following message box to enter

Ahentication Required

In my client application, I have the following code in routes\web.php file

Route::get('/', function () {
        $query = http_build_query([
            'client_id' => 3, // Replace with Client ID
            'redirect_uri' => '',
            'response_type' => 'code',
            'scope' => ''

        return redirect(''.$query);


If your redirect_uri in code>routes\web.php file of the client server and callback url of the client application in the OAuth server are different, you can see the above error message

edit client

So make sure you have the same URL for the both places