为了账号安全,请及时绑定邮箱和手机立即绑定

Coinbase 无效 404 请求 OAuth2 Guzzle

Coinbase 无效 404 请求 OAuth2 Guzzle

PHP
一只斗牛犬 2023-09-22 17:34:22
我尝试使用 OAuth2 在 coinbase 中进行授权:        $client = new Client(['cookies' => true]);        try {            $response = $client->request('POST', $this->urlAccessToken, [                'headers' => [                    'cache-control' => 'no-cache',                    'Content-Type' => 'application/x-www-form-urlencoded'                ],                'form_params' => [                    'grant_type' => 'authorization_code',                    'code' => $request->code,                    'client_id' => $this->clientId,                    'client_secret' => $this->clientSecret,                    'redirect_uri' => $this->redirectUri                ]            ]);            dd($response->getBody());        } catch (\Exception $e) {            return response($e->getMessage(), 400);        }在 coinbase 中授权后,我重定向到重定向 URI,当发送请求交换代码时,我看到错误的响应:客户端错误:POST http://www.coinbase.com/oauth/token导致404 Not Found响应:请求无效。您应该使用有效的 POST 参数发出 POST,而不是 GET 请求。欲了解更多信息(截断...)
查看完整描述

1 回答

?
红糖糍粑

TA贡献1815条经验 获得超6个赞

问题出在 URL 访问令牌中,需要https://api.coinbase.com/oauth/token改用http://www.coinbase.com/oauth/token



查看完整回答
反对 回复 2023-09-22
  • 1 回答
  • 0 关注
  • 67 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信