magento-client-php icon indicating copy to clipboard operation
magento-client-php copied to clipboard

How do you get the OAuth token?

Open frankpinto opened this issue 9 years ago • 3 comments

As I understand it Magento uses three-legged OAuth 1.0a (source: http://devdocs.magento.com/guides/m1x/api/rest/introduction.html#RESTAPIIntroduction-CreateasimpleproductasanAdminuserwithOAuthauthentication). In three-legged OAuth 1.0a you start with a key / secret and get the token from the service (http://oauthbible.com/#oauth-10a-three-legged). How do you get the token using this library? Are you supposed to write something to get the token before you use this library?

frankpinto avatar Nov 12 '15 01:11 frankpinto

+1

giolvani avatar Nov 15 '15 17:11 giolvani

+1

SeanProulx avatar Nov 22 '16 21:11 SeanProulx

Hello,

I've the same problem. $callbackUrl = "https://xxxx/order/api/list";

    // connect with key and secret
    $client = $this->magentoRestClient::factory(array(
        'base_url'        => 'http://xxxx.local',
        'consumer_key'    => '123456789012345678901234567890',
        'consumer_secret' => '123456789012345678901234567890',
        'callback' => $callbackUrl,
    ));
    
    // Get token and token_secret
    $requestToken = $client->getRequestToken();

    // Get url to authorize the token
    $adminAuthUrl = $requestToken->getAuthUrl('/admin/oauth_authorize');

But after that i dont know what to do ... Do you have resolv this ?

Kind regards

wash34000 avatar Dec 04 '19 10:12 wash34000