因此,我正在尝试使用SoundCloud API获得一个播放列表,但在设置访问令牌时,我将得到一个401。
<?PHP
require_once('Services/Soundcloud.php');
$client = new Services_Soundcloud('id', 'secret', 'uri');
if (!isset($_GET['code']))
{
header("Location: " . $client->getAuthorizeUrl());
}
$access_token = $client->accessToken($_GET['code']);
$client->setAccessToken($access_token);
?>我认为我重用访问令牌可能是个问题(也许?)。我没有把握。
发布于 2014-04-12 15:10:52
通过简单地添加带有“未到期”的that“作用域”,然后使用该代码来解决这个问题。
header("Location: " . $client->getAuthorizeUrl(array('scope' => 'non-expiring'));发布于 2014-04-14 09:05:32
不知为什么它又坏了。我收到以散列(#)结尾的代码,当我试图用$_GET['code']获取它们时,它会被剥离。即使我手动添加哈希,身份验证仍然以401结尾,因此我假设这是一个内部错误。
https://stackoverflow.com/questions/23031661
复制相似问题