|
| __construct ($options=null) |
|
| getRequestToken (array $customServiceParameters=null, $httpMethod=null, Zend_Oauth_Http_RequestToken $request=null) |
|
| getRedirectUrl (array $customServiceParameters=null, Zend_Oauth_Token_Request $token=null, Zend_Oauth_Http_UserAuthorization $redirect=null) |
|
| redirect (array $customServiceParameters=null, Zend_Oauth_Token_Request $token=null, Zend_Oauth_Http_UserAuthorization $request=null) |
|
| getAccessToken ( $queryData, Zend_Oauth_Token_Request $token, $httpMethod=null, Zend_Oauth_Http_AccessToken $request=null) |
|
| getLastRequestToken () |
|
| getLastAccessToken () |
|
| getToken () |
|
| __call ($method, array $args) |
|
Definition at line 49 of file Consumer.php.
◆ __construct()
__construct |
( |
|
$options = null | ) |
|
Constructor; create a new object with an optional array|Zend_Config instance containing initialising options.
- Parameters
-
- Returns
- void
Definition at line 79 of file Consumer.php.
86 $this->_config->setOptions(
$options);
◆ __call()
__call |
( |
|
$method, |
|
|
array |
$args |
|
) |
| |
Simple Proxy to the current Zend_Oauth_Config method. It's that instance which holds all configuration methods and values this object also presents as it's API.
- Parameters
-
- Returns
- mixed
- Exceptions
-
Definition at line 271 of file Consumer.php.
273 if (!method_exists($this->_config,
$method)) {
274 #require_once 'Zend/Oauth/Exception.php'; 277 return call_user_func_array(array($this->_config,
$method), $args);
◆ getAccessToken()
Retrieve an Access Token in exchange for a previously received/authorized Request Token.
- Parameters
-
- Returns
- Zend_Oauth_Token_Access
- Exceptions
-
Zend_Oauth_Exception | on invalid authorization token, non-matching response authorization token, or unprovided authorization token |
Definition at line 184 of file Consumer.php.
191 if (!$authorizedToken->isValid()) {
192 #require_once 'Zend/Oauth/Exception.php'; 194 'Response from Service Provider is not a valid authorized request token');
201 if ($authorizedToken->getParam(
'oauth_verifier') !==
null) {
203 'oauth_verifier' => $authorizedToken->getParam(
'oauth_verifier')
207 if ($httpMethod !==
null) {
210 $request->setMethod($this->getRequestMethod());
213 if ($authorizedToken->getToken() !==
$token->getToken()) {
214 #require_once 'Zend/Oauth/Exception.php'; 216 'Authorized token from Service Provider does not match' 217 .
' supplied Request Token details' 221 #require_once 'Zend/Oauth/Exception.php'; 224 $this->_requestToken =
$token;
225 $this->_accessToken =
$request->execute();
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ getLastAccessToken()
◆ getLastRequestToken()
◆ getRedirectUrl()
After a Request Token is retrieved, the user may be redirected to the OAuth Provider to authorize the application's access to their protected resources - the redirect URL being provided by this method. Once the user has authorized the application for access, they are redirected back to the application which can now exchange the previous Request Token for a fully authorized Access Token.
- Parameters
-
null | array | $customServiceParameters | |
null | Zend_Oauth_Token_Request | $token | |
null | Zend_OAuth_Http_UserAuthorization | $redirect | |
- Returns
- string
Definition at line 132 of file Consumer.php.
137 if ($redirect ===
null) {
139 }
elseif($customServiceParameters !==
null) {
143 $this->_requestToken =
$token;
145 return $redirect->
getUrl();
elseif(isset( $params[ 'redirect_parent']))
setParameters(array $customServiceParameters)
◆ getRequestToken()
Attempts to retrieve a Request Token from an OAuth Provider which is later exchanged for an authorized Access Token used to access the protected resources exposed by a web service API.
- Parameters
-
null | array | $customServiceParameters | Non-OAuth Provider-specified parameters |
null | string | $httpMethod | |
null | Zend_Oauth_Http_RequestToken | $request | |
- Returns
- Zend_Oauth_Token_Request
Definition at line 100 of file Consumer.php.
107 }
elseif($customServiceParameters !==
null) {
108 $request->setParameters($customServiceParameters);
110 if ($httpMethod !==
null) {
113 $request->setMethod($this->getRequestMethod());
115 $this->_requestToken =
$request->execute();
elseif(isset( $params[ 'redirect_parent']))
◆ getToken()
◆ redirect()
Rather than retrieve a redirect URL for use, e.g. from a controller, one may perform an immediate redirect.
Sends headers and exit()s on completion.
- Parameters
-
- Returns
- void
Definition at line 159 of file Consumer.php.
169 header(
'Location: ' . $redirectUrl);
getRedirectUrl(array $customServiceParameters=null, Zend_Oauth_Token_Request $token=null, Zend_Oauth_Http_UserAuthorization $redirect=null)
◆ $_accessToken
◆ $_config
◆ $_requestToken
◆ $switcheroo
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Oauth/Consumer.php