Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Oauth_Adminhtml_Oauth_Admin_TokenController
  • Mage_Oauth_Adminhtml_Oauth_AuthorizeController
  • Mage_Oauth_Adminhtml_Oauth_AuthorizedTokensController
  • Mage_Oauth_Adminhtml_Oauth_ConsumerController
  • Mage_Oauth_AuthorizeController
  • Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token
  • Mage_Oauth_Block_Adminhtml_Oauth_Admin_Token_Grid
  • Mage_Oauth_Block_Adminhtml_Oauth_Authorize
  • Mage_Oauth_Block_Adminhtml_Oauth_Authorize_Button
  • Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens
  • Mage_Oauth_Block_Adminhtml_Oauth_AuthorizedTokens_Grid
  • Mage_Oauth_Block_Adminhtml_Oauth_Consumer
  • Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit
  • Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Edit_Form
  • Mage_Oauth_Block_Adminhtml_Oauth_Consumer_Grid
  • Mage_Oauth_Block_Authorize
  • Mage_Oauth_Block_Authorize_Abstract
  • Mage_Oauth_Block_Authorize_Button
  • Mage_Oauth_Block_Authorize_ButtonBaseAbstract
  • Mage_Oauth_Block_AuthorizeBaseAbstract
  • Mage_Oauth_Block_Customer_Token_List
  • Mage_Oauth_Customer_TokenController
  • Mage_Oauth_Exception
  • Mage_Oauth_Helper_Data
  • Mage_Oauth_InitiateController
  • Mage_Oauth_Model_Consumer
  • Mage_Oauth_Model_Consumer_Validator_KeyLength
  • Mage_Oauth_Model_Nonce
  • Mage_Oauth_Model_Observer
  • Mage_Oauth_Model_Resource_Consumer
  • Mage_Oauth_Model_Resource_Consumer_Collection
  • Mage_Oauth_Model_Resource_Nonce
  • Mage_Oauth_Model_Resource_Nonce_Collection
  • Mage_Oauth_Model_Resource_Setup
  • Mage_Oauth_Model_Resource_Token
  • Mage_Oauth_Model_Resource_Token_Collection
  • Mage_Oauth_Model_Server
  • Mage_Oauth_Model_Token
  • Mage_Oauth_TokenController
  • Overview
  • Package
  • Class
  • Tree

Class Mage_Oauth_Model_Server

oAuth Server

Package: Mage\Oauth
Category: Mage
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Author: Magento Core Team <core@magentocommerce.com>
Located at code/core/Mage/Oauth/Model/Server.php
Methods summary
public
# __construct( Zend_Controller_Request_Http $request = null )

Internal constructor not depended on params

Internal constructor not depended on params

Parameters

$request
Zend_Controller_Request_Http
$request OPTIONAL Request object (If not specified - use singleton)

Throws

Exception
protected Mage_Oauth_Model_Server
# _fetchParams( )

Retrieve protocol and request parameters from request object

Retrieve protocol and request parameters from request object

Returns

Mage_Oauth_Model_Server

Link

http://tools.ietf.org/html/rfc5849#section-3.5
protected Mage_Oauth_Model_Server
# _fetchProtocolParamsFromQuery( )

Retrieve protocol parameters from query string

Retrieve protocol parameters from query string

Returns

Mage_Oauth_Model_Server
protected Zend_Controller_Response_Http
# _getResponse( )

Retrieve response object

Retrieve response object

Returns

Zend_Controller_Response_Http
protected
# _initConsumer( )

Initialize consumer

Initialize consumer

Throws

Mage_Oauth_Exception
protected Mage_Oauth_Model_Server
# _initToken( )

Load token object, validate it depending on request type, set access data and save

Load token object, validate it depending on request type, set access data and save

Returns

Mage_Oauth_Model_Server

Throws

Mage_Oauth_Exception
protected boolean
# _isProtocolParameter( string $attrName )

Is attribute is referred to oAuth protocol?

Is attribute is referred to oAuth protocol?

Parameters

$attrName
string
$attrName

Returns

boolean
protected Mage_Oauth_Model_Server
# _processRequest( string $requestType )

Extract parameters from sources (GET, FormBody, Authorization header), decode them and validate

Extract parameters from sources (GET, FormBody, Authorization header), decode them and validate

Parameters

$requestType
string
$requestType Request type - one of REQUEST_... class constant

Returns

Mage_Oauth_Model_Server

Throws

Mage_Core_Exception
protected
# _saveToken( )

Save token

Save token

protected
# _throwException( string $message = '', integer $code = 0 )

Throw OAuth exception

Throw OAuth exception

Parameters

$message
string
$message Exception message
$code
integer
$code Exception code

Throws

Mage_Oauth_Exception
protected
# _validateCallbackUrlParam( )

Check for 'oauth_callback' parameter

Check for 'oauth_callback' parameter

protected
# _validateNonce( string $nonce, string|integer $timestamp )

Validate nonce request data

Validate nonce request data

Parameters

$nonce
string
$nonce Nonce string
$timestamp
string|integer
$timestamp UNIX Timestamp
protected
# _validateProtocolParams( )

Validate protocol parameters

Validate protocol parameters

Throws

Mage_Oauth_Exception
protected
# _validateSignature( )

Validate signature

Validate signature

Throws

Mage_Oauth_Exception
protected
# _validateTokenParam( )

Check for 'oauth_token' parameter

Check for 'oauth_token' parameter

protected
# _validateVerifierParam( )

Check for 'oauth_verifier' parameter

Check for 'oauth_verifier' parameter

public
# accessToken( )

Process request for permanent access token

Process request for permanent access token

public Mage_Oauth_Model_Token
# authorizeToken( integer $userId, string $userType )

Validate request, authorize token and return it

Validate request, authorize token and return it

Parameters

$userId
integer
$userId Authorization user identifier
$userType
string
$userType Authorization user type

Returns

Mage_Oauth_Model_Token
public Mage_Oauth_Model_Token
# checkAccessRequest( )

Validate request with access token for specified URL

Validate request with access token for specified URL

Returns

Mage_Oauth_Model_Token
public Mage_Oauth_Model_Token
# checkAuthorizeRequest( )

Check authorize request for validity and return token

Check authorize request for validity and return token

Returns

Mage_Oauth_Model_Token
public static array
# getSupportedSignatureMethods( )

Retrieve array of supported signature methods

Retrieve array of supported signature methods

Returns

array
public
# initiateToken( )

Process request for temporary (initiative) token

Process request for temporary (initiative) token

public string
# reportProblem( Exception $e, Zend_Controller_Response_Http $response = null )

Create response string for problem during request and set HTTP error code

Create response string for problem during request and set HTTP error code

Parameters

$e
Exception
$e
$response
Zend_Controller_Response_Http
$response OPTIONAL If NULL - will use internal getter

Returns

string
public Mage_Oauth_Model_Server
# setResponse( Zend_Controller_Response_Http $response )

Set response object

Set response object

Parameters

$response
Zend_Controller_Response_Http
$response

Returns

Mage_Oauth_Model_Server
Constants summary
integer ERR_OK 0
#

OAuth result statuses

OAuth result statuses

integer ERR_VERSION_REJECTED 1
#
integer ERR_PARAMETER_ABSENT 2
#
integer ERR_PARAMETER_REJECTED 3
#
integer ERR_TIMESTAMP_REFUSED 4
#
integer ERR_NONCE_USED 5
#
integer ERR_SIGNATURE_METHOD_REJECTED 6
#
integer ERR_SIGNATURE_INVALID 7
#
integer ERR_CONSUMER_KEY_REJECTED 8
#
integer ERR_TOKEN_USED 9
#
integer ERR_TOKEN_EXPIRED 10
#
integer ERR_TOKEN_REVOKED 11
#
integer ERR_TOKEN_REJECTED 12
#
integer ERR_VERIFIER_INVALID 13
#
integer ERR_PERMISSION_UNKNOWN 14
#
integer ERR_PERMISSION_DENIED 15
#
string SIGNATURE_HMAC 'HMAC-SHA1'
#

Signature Methods

Signature Methods

string SIGNATURE_RSA 'RSA-SHA1'
#
string SIGNATURE_PLAIN 'PLAINTEXT'
#
string REQUEST_INITIATE 'initiate'
#

Request Types

Request Types

string REQUEST_AUTHORIZE 'authorize'
#
string REQUEST_TOKEN 'token'
#
string REQUEST_RESOURCE 'resource'
#
integer HTTP_OK 200
#

HTTP Response Codes

HTTP Response Codes

integer HTTP_BAD_REQUEST 400
#
integer HTTP_UNAUTHORIZED 401
#
integer HTTP_INTERNAL_ERROR 500
#
integer TIME_DEVIATION 600
#

Possible time deviation for timestamp validation in sec.

Possible time deviation for timestamp validation in sec.

string CALLBACK_ESTABLISHED 'oob'
#

Value of callback URL when it is established or if cliaent is unable to receive callbacks

Value of callback URL when it is established or if cliaent is unable to receive callbacks

Link

Requirement in RFC-5849
Properties summary
protected Mage_Oauth_Model_Consumer $_consumer
#

Consumer object

Consumer object

protected array $_errors array( self::ERR_VERSION_REJECTED => 'version_rejected', self::ERR_PARAMETER_ABSENT => 'parameter_absent', self::ERR_PARAMETER_REJECTED => 'parameter_rejected', self::ERR_TIMESTAMP_REFUSED => 'timestamp_refused', self::ERR_NONCE_USED => 'nonce_used', self::ERR_SIGNATURE_METHOD_REJECTED => 'signature_method_rejected', self::ERR_SIGNATURE_INVALID => 'signature_invalid', self::ERR_CONSUMER_KEY_REJECTED => 'consumer_key_rejected', self::ERR_TOKEN_USED => 'token_used', self::ERR_TOKEN_EXPIRED => 'token_expired', self::ERR_TOKEN_REVOKED => 'token_revoked', self::ERR_TOKEN_REJECTED => 'token_rejected', self::ERR_VERIFIER_INVALID => 'verifier_invalid', self::ERR_PERMISSION_UNKNOWN => 'permission_unknown', self::ERR_PERMISSION_DENIED => 'permission_denied' )
#

Error code to error messages pairs

Error code to error messages pairs

protected array $_errorsToHttpCode array( self::ERR_VERSION_REJECTED => self::HTTP_BAD_REQUEST, self::ERR_PARAMETER_ABSENT => self::HTTP_BAD_REQUEST, self::ERR_PARAMETER_REJECTED => self::HTTP_BAD_REQUEST, self::ERR_TIMESTAMP_REFUSED => self::HTTP_BAD_REQUEST, self::ERR_NONCE_USED => self::HTTP_UNAUTHORIZED, self::ERR_SIGNATURE_METHOD_REJECTED => self::HTTP_BAD_REQUEST, self::ERR_SIGNATURE_INVALID => self::HTTP_UNAUTHORIZED, self::ERR_CONSUMER_KEY_REJECTED => self::HTTP_UNAUTHORIZED, self::ERR_TOKEN_USED => self::HTTP_UNAUTHORIZED, self::ERR_TOKEN_EXPIRED => self::HTTP_UNAUTHORIZED, self::ERR_TOKEN_REVOKED => self::HTTP_UNAUTHORIZED, self::ERR_TOKEN_REJECTED => self::HTTP_UNAUTHORIZED, self::ERR_VERIFIER_INVALID => self::HTTP_UNAUTHORIZED, self::ERR_PERMISSION_UNKNOWN => self::HTTP_UNAUTHORIZED, self::ERR_PERMISSION_DENIED => self::HTTP_UNAUTHORIZED )
#

Error code to HTTP error code

Error code to HTTP error code

protected array $_params array()
#

Request parameters

Request parameters

protected array $_protocolParams array()
#

Protocol parameters

Protocol parameters

protected Mage_Core_Controller_Request_Http $_request
#

Request object

Request object

protected string $_requestType
#

Request type: initiate, permanent token request or authorized one

Request type: initiate, permanent token request or authorized one

protected Zend_Controller_Response_Http $_response null
#

Response object

Response object

protected Mage_Oauth_Model_Token $_token
#

Token object

Token object

Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0