Created
April 26, 2018 15:29
-
-
Save quickshiftin/da65b3b813ee055bf2d83063ee944e91 to your computer and use it in GitHub Desktop.
Example fetching an OAuth access token in Magento2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Using thephpleague/oauth1-client | |
// https://github.com/thephpleague/oauth1-client | |
require_once __DIR__.'/../../vendor/autoload.php'; | |
// Create server | |
$server = new League\OAuth1\Client\Server\Magento(array( | |
'identifier' => $data['consumerKey'], | |
'secret' => $data['consumerSecret'], | |
'callback_uri' => "http://mage-access.local/oath.php/", | |
)); | |
$temporaryCredentials = $server->getTemporaryCredentials(); | |
$server->getTokenCredentials($temporaryCredentials, $requestToken['oauth_token'], $requestToken['oauth_token_secret']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment