|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| getRequestToken ($params, $requestUrl, $httpMethod='POST') | |
| getAccessToken ($params, $requestUrl, $httpMethod='POST') | |
| validateAccessTokenRequest ($params, $requestUrl, $httpMethod='POST') | |
| validateAccessToken ($accessToken) | |
Data Fields | |
| const | ERR_OK = 0 |
| const | ERR_VERSION_REJECTED = 1 |
| const | ERR_PARAMETER_ABSENT = 2 |
| const | ERR_PARAMETER_REJECTED = 3 |
| const | ERR_TIMESTAMP_REFUSED = 4 |
| const | ERR_NONCE_USED = 5 |
| const | ERR_SIGNATURE_METHOD_REJECTED = 6 |
| const | ERR_SIGNATURE_INVALID = 7 |
| const | ERR_CONSUMER_KEY_REJECTED = 8 |
| const | ERR_TOKEN_USED = 9 |
| const | ERR_TOKEN_EXPIRED = 10 |
| const | ERR_TOKEN_REVOKED = 11 |
| const | ERR_TOKEN_REJECTED = 12 |
| const | ERR_VERIFIER_INVALID = 13 |
| const | ERR_PERMISSION_UNKNOWN = 14 |
| const | ERR_PERMISSION_DENIED = 15 |
| const | ERR_METHOD_NOT_ALLOWED = 16 |
| const | ERR_CONSUMER_KEY_INVALID = 17 |
| const | SIGNATURE_SHA1 = 'HMAC-SHA1' |
| const | SIGNATURE_SHA256 = 'HMAC-SHA256' |
OauthInterface provides methods consistent with implementing a 2-legged OAuth authentication mechanism. Methods include creating a request token, getting an access token, and performing certain validations on tokens and token requests. A method is also included for generating an OAuth header that can be used in an HTTP request.
@api
Definition at line 16 of file OauthInterface.php.
| getAccessToken | ( | $params, | |
| $requestUrl, | |||
$httpMethod = 'POST' |
|||
| ) |
Get access token for a pre-authorized request token.
| array | $params | - Array containing parameters necessary for requesting Access Token.
array (
'oauth_version' => '1.0',
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => 'a6aa81cc3e65e2960a487939244sssss',
'oauth_nonce' => 'rI7PSWxTZRHWU3R',
'oauth_timestamp' => '1377183099',
'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718',
'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D',
'oauth_verifier' => 'a6aa81cc3e65e2960a487939244vvvvv'
)
|
| string | $requestUrl | - The request Url. |
| string | $httpMethod | - (default: 'POST') |
array (
'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf',
'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
)
Implemented in Oauth.
| getRequestToken | ( | $params, | |
| $requestUrl, | |||
$httpMethod = 'POST' |
|||
| ) |
#- Issue a pre-authorization request token to the caller.
| array | $params | - Array containing parameters necessary for requesting Request Token.
array (
'oauth_version' => '1.0',
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_nonce' => 'rI7PSWxTZRHWU3R',
'oauth_timestamp' => '1377183099',
'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718',
'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D'
)
|
| string | $requestUrl | - The request Url. |
| string | $httpMethod | - (default: 'POST') |
array (
'oauth_token' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf',
'oauth_token_secret' => 'gshsjkndtyhwjhdbutfgbsnhtrequikf'
)
Implemented in Oauth.
| validateAccessToken | ( | $accessToken | ) |
Validate an access token string.
| string | $accessToken | - The access token. |
Implemented in Oauth.
| validateAccessTokenRequest | ( | $params, | |
| $requestUrl, | |||
$httpMethod = 'POST' |
|||
| ) |
Validate an access token request.
| array | $params | - Array containing parameters necessary for validating Access Token.
array (
'oauth_version' => '1.0',
'oauth_signature_method' => 'HMAC-SHA1',
'oauth_token' => 'a6aa81cc3e65e2960a487939244sssss',
'oauth_nonce' => 'rI7PSWxTZRHWU3R',
'oauth_timestamp' => '1377183099',
'oauth_consumer_key' => 'a6aa81cc3e65e2960a4879392445e718',
'oauth_signature' => 'VNg4mhFlXk7%2FvsxMqqUd5DWIj9s%3D'
)
|
| string | $requestUrl | - The request Url. |
| string | $httpMethod | - (default: 'POST') |
Implemented in Oauth.
| const ERR_CONSUMER_KEY_INVALID = 17 |
Definition at line 55 of file OauthInterface.php.
| const ERR_CONSUMER_KEY_REJECTED = 8 |
Definition at line 37 of file OauthInterface.php.
| const ERR_METHOD_NOT_ALLOWED = 16 |
Definition at line 53 of file OauthInterface.php.
| const ERR_NONCE_USED = 5 |
Definition at line 31 of file OauthInterface.php.
| const ERR_OK = 0 |
#+ OAuth result statuses
Definition at line 21 of file OauthInterface.php.
| const ERR_PARAMETER_ABSENT = 2 |
Definition at line 25 of file OauthInterface.php.
| const ERR_PARAMETER_REJECTED = 3 |
Definition at line 27 of file OauthInterface.php.
| const ERR_PERMISSION_DENIED = 15 |
Definition at line 51 of file OauthInterface.php.
| const ERR_PERMISSION_UNKNOWN = 14 |
Definition at line 49 of file OauthInterface.php.
| const ERR_SIGNATURE_INVALID = 7 |
Definition at line 35 of file OauthInterface.php.
| const ERR_SIGNATURE_METHOD_REJECTED = 6 |
Definition at line 33 of file OauthInterface.php.
| const ERR_TIMESTAMP_REFUSED = 4 |
Definition at line 29 of file OauthInterface.php.
| const ERR_TOKEN_EXPIRED = 10 |
Definition at line 41 of file OauthInterface.php.
| const ERR_TOKEN_REJECTED = 12 |
Definition at line 45 of file OauthInterface.php.
| const ERR_TOKEN_REVOKED = 11 |
Definition at line 43 of file OauthInterface.php.
| const ERR_TOKEN_USED = 9 |
Definition at line 39 of file OauthInterface.php.
| const ERR_VERIFIER_INVALID = 13 |
Definition at line 47 of file OauthInterface.php.
| const ERR_VERSION_REJECTED = 1 |
Definition at line 23 of file OauthInterface.php.
| const SIGNATURE_SHA1 = 'HMAC-SHA1' |
#- #+ Signature Methods
Definition at line 62 of file OauthInterface.php.
| const SIGNATURE_SHA256 = 'HMAC-SHA256' |
Definition at line 64 of file OauthInterface.php.