Testing Laravel Passport OAuth2 page does not work: Authentication Required

Problem

I have OAuth2 server running properly at http://127.0.0.1:8000/ and I made another Laravel project to test the client application at http://127.0.0.1:8001. When I open the client application I am getting following message box to enter

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

Solution

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

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