在我的应用程序中,我想用我自己的Soundcloud用户使用Soundcloud API。 Soundcloud API身份验证过程涉及将用户重定向到Soundcloud主页,登录并授权应用程序,以便该页面可以为该用户使用API。没有用户交互的自动Soundcloud PHP Api身份验证
我想让整个过程自动化,因为我自己的用户是获得认证的唯一用户。那可能吗?
这是到目前为止我的代码:
$soundcloud = new \Services_Soundcloud(
'**',
'**',
'http://**'
);
$authorizeUrl = $soundcloud->getAuthorizeUrl();
$accessToken = $soundcloud->accessToken();
try {
$me = json_decode($soundcloud->get('me'), true);
} catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
exit($e->getMessage());
}
但行$accessToken = $soundcloud->accessToken();
抛出异常:
The requested URL responded with HTTP code 401.
500 Internal Server Error - Services_Soundcloud_Invalid_Http_Response_Code_Exception
我与Strae同意。 PHP SDK不能很好地工作。它抛出401错误,当我们正试图获得访问令牌。 – 2013-01-31 13:58:56
我必须说,我没能在PHP SDK – Strae 2013-02-01 08:07:33