php - Spotify web api回调php中的错误
问题描述
我已经尝试使用 jwilsson 的 Spotify-web-API,如下所述:https ://github.com/jwilsson/spotify-web-api-php/blob/master/docs/examples/access-token-with-authorization -代码流.md
我获得了工作授权,我在重定向的 URL 中收到代码并能够提取它,但是当我到达回调页面时出现以下错误:
致命错误:未捕获的 SpotifyWebAPI\SpotifyWebAPIAuthException:C:...\vendor\jwilsson\spotify-web-api-php\src\Request.php:49 中的重定向 URI 无效 堆栈跟踪:#0 C:...\vendor\ jwilsson\spotify-web-api-php\src\Request.php(242): SpotifyWebAPI\Request->parseBody(Object(stdClass), 400) #1 C:...\vendor\jwilsson\spotify-web-api -php\src\Request.php(99): SpotifyWebAPI\Request->send('POST', ' https://account ...', 'client_id=effb4...', Array) #2 C:. ..\vendor\jwilsson\spotify-web-api-php\src\Session.php(217): SpotifyWebAPI\Request->account('POST', '/api/token', Array, Array) #3 C: ...\callback.php(17): SpotifyWebAPI\Session->requestAccessToken('AQB5DWrr3FQ_WVq...') #4 {main} 在 C:...\vendor\jwilsson\spotify-web-api-php\源\请求。第 49 行的 php
我目前拥有的流程是:1)index.html 2)auth.php(进行身份验证并重定向到 callback.php)3)callback.php(获取访问令牌并使用我的 API 调用“app”重定向到页面.php") 4) app.php
第 2 点和第 3 点的页面在 Spotify 中注册为重定向 URI
解决方案
推荐阅读
- shopify - Weglot 将我的文字翻译两次,一个想法?
- bash - 在命令行中重复一个参数 N 次
- python - ImageDataBunch.from_folder 没有看到我的测试集
- java - AWS lambda 的 AmazonS3.readObject() 非常慢
- java - JHipster:org.apiguardian:apiguardian-api:1.1.0 的依赖收敛错误
- ios - 如何在 Combine 中对任意数量的 Bool Publisher 执行“全部”操作?
- html - 滚动时如何在 CSS 中转换图像
- matlab - 加载 MIT-BIH 心律失常数据库 (mitdb) ECG INTO MATLAB
- c# - 我如何在 C# 中拆分数组
- javascript - 如何添加数组VueJS?