CommonSense PHP API Library
OAuthProvider Class Reference

List of all members.

Public Member Functions

 __construct (&$request, $requestToCheck)
 addSignatureMethod ($signatureMethod)
 fetchRequestToken ()
 fetchAccessToken ()
 verifyRequest ($tokenType="access")
 checkConsumerRequest ()
 checkAuthorizationRequest ()
 checkTokenRequest ()
 checkAccessRequest ()
 generateVerifier ()
 getCallbackUrl ()
 redirectConsumer ($callback, $verifier)
 isConsumerAllowed ()
 getUserID ()

Static Public Member Functions

static sendResponse ($response, $responseType="request")
static reportProblem ($response, $statusCode=400)
static redirect ($url, $msg)

Public Attributes

const TOKEN_EXPIR_NEVER = -1

Protected Attributes

 $timestampThreshold = 300
 $version = "1.0"
 $signatureMethods = array()
 $ds

Constructor & Destructor Documentation

OAuthProvider::__construct ( &$  request,
requestToCheck 
)

Constructor.

Parameters:
OAuthRequest$request
string$requestToCheck(consumer | authorize | request | access)
Exceptions:
OAuthException

Member Function Documentation

OAuthProvider::addSignatureMethod ( signatureMethod)

Add a signature method.

Parameters:
OAuthSignatureMethod$signatureMethod

Check the required parameters each time the provider gets a resource consumption request.

Exceptions:
OAuthException
Returns:
boolean

Check required parameters in the authorization oauth step.

Exceptions:
OAuthException

Check required parameters in the request token step.

Exceptions:
OAuthException
Returns:
boolean

Check the required parameters in the access token request step.

Exceptions:
OAuthException
Returns:
boolean

Process an access_token request.

Returns:
OAuthToken

Process a request_token request.

Returns:
OAuthToken

Generate and store a verifier code.

Returns:
string

Retrieve the callback URL for a consumer.

Exceptions:
OAuthException
Returns:
string

Get the user id.

Returns:
The userID
Exceptions:
OAuthException

Check if the consumer app has been approved to consume resources.

Exceptions:
OAuthException
static OAuthProvider::redirect ( url,
msg 
) [static]

Redirect the browser to a given url. It could be set a message to send as GET parameter.

Parameters:
string$url
string$msg
OAuthProvider::redirectConsumer ( callback,
verifier 
)

Redirect the consumer to the callback URL.

Parameters:
string$callback
string$verifier
static OAuthProvider::reportProblem ( response,
statusCode = 400 
) [static]

Sends the response to the consumer (require pecl_http to work).

Parameters:
string$response
integer$statusCode
static OAuthProvider::sendResponse ( response,
responseType = "request" 
) [static]

Sends the response to the consumer (require pecl_http to work).

Parameters:
OAuthResponse$response
string$responseType
OAuthProvider::verifyRequest ( tokenType = "access")

This method is used only to check the temporary and access credentials, (access token and API consumption steps). It can't be used in the request token and authorization steps.

Parameters:
string$tokenType
Exceptions:
OAuthException

Member Data Documentation

OAuthProvider::$ds [protected]
OAuthProvider::$signatureMethods = array() [protected]
OAuthProvider::$timestampThreshold = 300 [protected]
OAuthProvider::$version = "1.0" [protected]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables