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
Route::get('/', function () { $query = http_build_query([ 'client_id' => 3, // Replace with Client ID 'redirect_uri' => 'http://127.0.0.1:8001/callback', 'response_type' => 'code', 'scope' => '' ]); return redirect('http://127.0.0.1:8000/oauth/authorize?'.$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
So make sure you have the same URL for the both places