Bharat Chodvadiya
Bharat Chodvadiya

Reputation: 1650

User authentication using magento api

I am using this code to authenticate user on magento is

$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);

but it display fatal error like this 'Class 'OAuth' not found'. I use this link for authentication magento authentication. Please review this and reply answer.

Thanks..

Upvotes: 0

Views: 1433

Answers (1)

Sebastian Schmidt
Sebastian Schmidt

Reputation: 1078

Please check if you have OAUth Extension for PHP installed. See http://www.php.net/manual/en/oauth.installation.php

Upvotes: 1

Related Questions