Laravel Passport token request times out

  Kiến thức lập trình

I am using Laravel 11 and need to setup passport for authentication


php artisan install:api --passport

Password grand setup

php artisan passport:client --password

The prompt suggested a name for the password grant and I pressed.
Ultimately it asked the following:

Which user provider should this client use to retrieve users?

I pressed enter, the client id & secret were generated, and I pasted them in my .env



I added the following to config/auth.php

'api' => [
    'driver' => 'passport',
    'provider' => 'users',

Lastly, I added the following to the boot method of AppServiceProvider


In api.php, I am attempting to request a token using a login route:

Route::post('/login', function(Request $request) {

    $request_url = env('APP_URL') . '/oauth/token';

    $response = Http::asForm()->post($request_url, [
        'grant_type' => 'password',
        'client_id' => env('PASSPORT_PASSWORD_CLIENT_ID'),
        'client_secret' => env('PASSPORT_PASSWORD_SECRET'),
        'username' => $request->email,
        'password' => $request->password,
        'scope' => '',
    return response()->json([
       'data' => $response->json()

In postman, I created a post request for

and set the body tab to form data

I see the following error when I hit the send button:

cURL error 28: Operation timed out after 30006 milliseconds with 0 bytes received (see for

Is there anything I am missing in my setup?

Theme wordpress giá rẻ Theme wordpress giá rẻ Thiết kế website