Support the ongoing development of Laravel.io →
Authentication

I am using Laravel Passport to request a token using authorization code.

$body = [ "grant_type" => "authorization_code", "client_id" => env('CLIENT_ID_AUTH'), "client_secret" => env('CLIENT_SECRET_AUTH'), 'redirect_uri' => env('GOOGLE_REDIRECT'), 'code' => $request->input('idToken'), 'scope' => '*' ];

        $response = Http::asForm()->post( env('APP_URL'). self::OAUTH_TOKEN, $body);

The response returns { "error": "invalid_request", "error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.", "hint": "Cannot decrypt the authorization code", "message": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed." }

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.