使用magento-api进行用户身份验证


User authentication using magento api

我正在使用此代码验证magento上的用户是否为

$redirecturi = 'http://localhost/magento';
$temporaryCredentialsRequestUrl = "http://localhost/magento/oauth/initiate?oauth_callback=".$redirecturi;
$customerAuthorizationUrl = 'http://localhost/magento/oauth/authorize';
$accessTokenRequestUrl = 'http://localhost/magento/oauth/token';
$oauthClient = new OAuth($consumerkey, $consumersecret, OAUTH_SIG_METHOD_HMACSHA1, OAUTH_AUTH_TYPE_URI);
$oauthClient->enableDebug();
$requestToken = $oauthClient->getRequestToken($temporaryCredentialsRequestUrl);
header('Location: '.$customerAuthorizationUrl.'?oauth_token='.$requestToken['oauth_token']);
exit(0);

但它显示了类似这样的致命错误"Class"OAuth"not found"。我使用此链接进行身份验证magento身份验证。请查看并回复答案。

谢谢。。

请检查您是否安装了用于PHP的OAUth扩展。看见http://www.php.net/manual/en/oauth.installation.php