|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (\Magento\Store\Model\StoreManagerInterface $storeManager, ConsumerFactory $consumerFactory, TokenFactory $tokenFactory, IntegrationOauthHelper $dataHelper, \Magento\Framework\HTTP\ZendClient $httpClient, \Psr\Log\LoggerInterface $logger, OauthHelper $oauthHelper, TokenProvider $tokenProvider) | |
| createConsumer ($consumerData) | |
| createAccessToken ($consumerId, $clearExistingToken=false) | |
| getAccessToken ($consumerId) | |
| loadConsumer ($consumerId) | |
| loadConsumerByKey ($key) | |
| postToConsumer ($consumerId, $endpointUrl) | |
| deleteConsumer ($consumerId) | |
| deleteIntegrationToken ($consumerId) | |
Protected Member Functions | |
| _loadConsumerById ($consumerId) | |
Protected Attributes | |
| $_storeManager | |
| $_consumerFactory | |
| $_tokenFactory | |
| $_dataHelper | |
| $_httpClient | |
| $_logger | |
| $_oauthHelper | |
| $_tokenProvider | |
Integration oAuth service.
@SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 23 of file OauthService.php.
| __construct | ( | \Magento\Store\Model\StoreManagerInterface | $storeManager, |
| ConsumerFactory | $consumerFactory, | ||
| TokenFactory | $tokenFactory, | ||
| IntegrationOauthHelper | $dataHelper, | ||
| \Magento\Framework\HTTP\ZendClient | $httpClient, | ||
| \Psr\Log\LoggerInterface | $logger, | ||
| OauthHelper | $oauthHelper, | ||
| TokenProvider | $tokenProvider | ||
| ) |
Initialize dependencies.
| \Magento\Store\Model\StoreManagerInterface | $storeManager | |
| ConsumerFactory | $consumerFactory | |
| TokenFactory | $tokenFactory | |
| IntegrationOauthHelper | $dataHelper | |
| \Magento\Framework\HTTP\ZendClient | $httpClient | |
| \Psr\Log\LoggerInterface | $logger | |
| OauthHelper | $oauthHelper | |
| TokenProvider | $tokenProvider |
Definition at line 82 of file OauthService.php.
|
protected |
Load consumer by id.
| int | $consumerId |
Definition at line 289 of file OauthService.php.
| createAccessToken | ( | $consumerId, | |
$clearExistingToken = false |
|||
| ) |
{Create access token for provided consumer.
| int | $consumerId | |
| bool | $clearExistingToken |
Implements OauthServiceInterface.
Definition at line 143 of file OauthService.php.
| createConsumer | ( | $consumerData | ) |
{Create a new consumer account.
| array | $consumerData | - Information provided by an integration when the integration is installed.
array(
'name' => 'Integration Name',
'...' => '...', // Other consumer data can be passed as well
)
|
Implements OauthServiceInterface.
Definition at line 121 of file OauthService.php.
| deleteConsumer | ( | $consumerId | ) |
{Delete the consumer data associated with the integration including its token and nonce
| int | $consumerId |
Implements OauthServiceInterface.
Definition at line 259 of file OauthService.php.
| deleteIntegrationToken | ( | $consumerId | ) |
{Remove token associated with provided consumer.
| int | $consumerId |
Implements OauthServiceInterface.
Definition at line 270 of file OauthService.php.
| getAccessToken | ( | $consumerId | ) |
{Retrieve access token assigned to the consumer.
| int | $consumerId |
Implements OauthServiceInterface.
Definition at line 167 of file OauthService.php.
| loadConsumer | ( | $consumerId | ) |
{Load consumer by its ID.
| int | $consumerId |
Implements OauthServiceInterface.
Definition at line 184 of file OauthService.php.
| loadConsumerByKey | ( | $key | ) |
{Load consumer by its key.
| string | $key |
Implements OauthServiceInterface.
Definition at line 200 of file OauthService.php.
| postToConsumer | ( | $consumerId, | |
| $endpointUrl | |||
| ) |
{Execute post to integration (consumer) HTTP Post URL. Generate and return oauth_verifier.
| int | $consumerId | - The consumer Id. |
| string | $endpointUrl | - The integration endpoint Url (for HTTP Post) |
Implements OauthServiceInterface.
Definition at line 216 of file OauthService.php.
|
protected |
Definition at line 33 of file OauthService.php.
|
protected |
Definition at line 43 of file OauthService.php.
|
protected |
Definition at line 48 of file OauthService.php.
|
protected |
Definition at line 53 of file OauthService.php.
|
protected |
Definition at line 58 of file OauthService.php.
|
protected |
Definition at line 28 of file OauthService.php.
|
protected |
Definition at line 38 of file OauthService.php.
|
protected |
Definition at line 63 of file OauthService.php.