学习laravel的passport,跟着文档的例子做的,走到 将授权码转化为访问令牌 这一步报错了,说请求缺少一个必须的参数,包含了一个无效的参数,可我看了半天没看出来是哪里戳错,求大佬指导一下!
报错信息:
我的web路由部分代码:
Route::get('/auth/callback', function (\Illuminate\Http\Request $request) {
$client = new GuzzleHttp\Client;
$response = $client->post('http://api.test/oauth/token', [
'form_params' => [
'grant_type' => 'authorization_code',
'client_id' => 3,
'client_secret' => 'AMCVpFBHFuVa5VPF3MQfcerdsnn3W9hMwmW0Xjxh',
'redirect_url' => 'http://api.test/auth/callback',
'code' => $request->input('code'),
],
]);
return json_decode((string)$response->getBody(),true);
});
进入这个路由的完整地址:
http://api.test/auth/callback?code=def502002d9543c0e46487f8efd4f580f3a2aac577e296c132195ec1c96ea7266d05f807f319aa51a8b8ee981ad0a00fd4785d9af94dd557be534da5bc8d9fedf81b032a3c1597b293d3f0de12cde0bcc9a6e04f9c8206de0747763690ef7d7432340c6c3e1741e15cc6cfa32bfe9bcf72da17f764268837b7db2c9de39e4c099a2d107db4da4c4fd989335f405612f597a9d7218c6a1552acdac59ea9d27cda749381ba6a2c659b6f1adc11ef2cdd2e7561f112ac0c6a3ce5575628b42e08116364916aae16f900d0226266f1eb21b5778dd6e1e9a30e0c9daec63328bad44653de24dd6fba61ed65ac6095bdb34a4196f4ac10a15d61c3f588eee8a5e2438734711370d963ae338299a465dcbddd0f7f5524459a1a6658efd2d2620b0822d34355cdcbb2b8e3e6be4e21f1ef0aba3df3debc61049cf11a8fdee8f8cd967d4b54
- 2 回答
- 0 关注
- 537 浏览
添加回答
举报
0/150
提交
取消