Php 使用MagentoAPI进行用户身份验证

Php 使用MagentoAPI进行用户身份验证,php,api,magento,Php,Api,Magento,我正在使用此代码对magento上的用户进行身份验证 $redirecturi = 'http://localhost/magento'; $temporaryCredentialsRequestUrl = "http://localhost/magento/oauth/initiate?oauth_callback=".$redirecturi; $customerAuthorizationUrl = 'http://localhost/magento/oauth/authorize'; $a

我正在使用此代码对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);
但它会显示如下“类”OAuth“未找到”这样的致命错误。我使用此链接进行身份验证。 请复习并回复答案


谢谢..

请检查是否安装了用于PHP的OAUth扩展。请参阅

请帮助我安装oauth扩展,并给我提供要添加的库文件。您需要的库文件取决于您的PHP版本和服务器操作系统。你所需要的就是我上面发布的链接。