|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / vendor / magento / framework / Oauth / |
Filename | /home/a/home/dev2.destoffenstraat.com/vendor/magento/framework/Oauth/TokenProviderInterface.php |
Size | 3.75 kb |
Permission | rw-r--r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Jan-2021 21:08 |
Last accessed | 22-Aug-2025 21:43 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Oauth;
/**
* TokenProviderInterface provides token manipulation, such as creating a request token and getting an access token
* as well as methods for performing certain validations on tokens and token requests. Consumer methods are also
* provided to help clients manipulating tokens validate and acquire the associated token consumer.
*
* @api
* @since 100.0.2
*/
interface TokenProviderInterface
{
/**
* Validate the consumer.
*
* @param ConsumerInterface $consumer The consumer.
* @return bool True if the consumer is valid.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateConsumer($consumer);
/**
* Create a request token for the specified consumer.
* Example:
* <pre>
* array(
* 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf,
* 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
* )
* </pre>
*
* @param ConsumerInterface $consumer
* @return array The request token and secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function createRequestToken($consumer);
/**
* Validates the request token and verifier. Verifies the request token is associated with the consumer.
*
* @param string $requestToken The 'oauth_token' request token value.
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @param string $oauthVerifier The 'oauth_verifier' value.
* @return string The request token secret (i.e. 'oauth_token_secret').
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateRequestToken($requestToken, $consumer, $oauthVerifier);
/**
* Retrieve access token for the specified consumer given the consumer key.
* Example:
* <pre>
* array(
* 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf,
* 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
* )
* </pre>
*
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @return array The access token and secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function getAccessToken($consumer);
/**
* Validates the Oauth token type and verifies that it's associated with the consumer.
*
* @param string $accessToken The 'oauth_token' access token value.
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @return string The access token secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateAccessTokenRequest($accessToken, $consumer);
/**
* Validate an access token string.
*
* @param string $accessToken The 'oauth_token' access token string.
* @return int Consumer ID if the access token is valid.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateAccessToken($accessToken);
/**
* Perform basic validation of an Oauth token, of any type (e.g. request, access, etc.).
*
* @param string $oauthToken The token string.
* @return bool True if the Oauth token passes basic validation.
*/
public function validateOauthToken($oauthToken);
/**
* Retrieve a consumer given the consumer's key.
*
* @param string $consumerKey The 'oauth_consumer_key' value.
* @return ConsumerInterface
* @throws \Magento\Framework\Oauth\Exception
*/
public function getConsumerByKey($consumerKey);
}
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\Oauth;
/**
* TokenProviderInterface provides token manipulation, such as creating a request token and getting an access token
* as well as methods for performing certain validations on tokens and token requests. Consumer methods are also
* provided to help clients manipulating tokens validate and acquire the associated token consumer.
*
* @api
* @since 100.0.2
*/
interface TokenProviderInterface
{
/**
* Validate the consumer.
*
* @param ConsumerInterface $consumer The consumer.
* @return bool True if the consumer is valid.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateConsumer($consumer);
/**
* Create a request token for the specified consumer.
* Example:
* <pre>
* array(
* 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf,
* 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
* )
* </pre>
*
* @param ConsumerInterface $consumer
* @return array The request token and secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function createRequestToken($consumer);
/**
* Validates the request token and verifier. Verifies the request token is associated with the consumer.
*
* @param string $requestToken The 'oauth_token' request token value.
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @param string $oauthVerifier The 'oauth_verifier' value.
* @return string The request token secret (i.e. 'oauth_token_secret').
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateRequestToken($requestToken, $consumer, $oauthVerifier);
/**
* Retrieve access token for the specified consumer given the consumer key.
* Example:
* <pre>
* array(
* 'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf,
* 'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
* )
* </pre>
*
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @return array The access token and secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function getAccessToken($consumer);
/**
* Validates the Oauth token type and verifies that it's associated with the consumer.
*
* @param string $accessToken The 'oauth_token' access token value.
* @param ConsumerInterface $consumer The consumer given the 'oauth_consumer_key'.
* @return string The access token secret.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateAccessTokenRequest($accessToken, $consumer);
/**
* Validate an access token string.
*
* @param string $accessToken The 'oauth_token' access token string.
* @return int Consumer ID if the access token is valid.
* @throws \Magento\Framework\Oauth\Exception Validation errors.
*/
public function validateAccessToken($accessToken);
/**
* Perform basic validation of an Oauth token, of any type (e.g. request, access, etc.).
*
* @param string $oauthToken The token string.
* @return bool True if the Oauth token passes basic validation.
*/
public function validateOauthToken($oauthToken);
/**
* Retrieve a consumer given the consumer's key.
*
* @param string $consumerKey The 'oauth_consumer_key' value.
* @return ConsumerInterface
* @throws \Magento\Framework\Oauth\Exception
*/
public function getConsumerByKey($consumerKey);
}