PHP Class XeroPHP\Remote\OAuth\Client

It's loosely based on the functionality of the SimpleOAuth class, which comes in the recommended php developer kit.
Author: Michael Calcinai
Mostra file Open project: calcinai/xero-php Class Usage Examples

Public Methods

Method Description
__construct ( array $config )
getAuthorizeURL ( ) : string
getSBS ( ) : string Get the Signature Base String for signing.
getToken ( )
getTokenSecret ( )
getVerifier ( )
setToken ( $token )
setTokenSecret ( $secret ) Populated during 3-legged auth
setVerifier ( $verifier )
sign ( Request $request ) This actually signs the request.

Private Methods

Method Description
getCallback ( ) : string
getConsumerKey ( ) : string
getConsumerSecret ( ) : string
getNonce ( integer $length = 20 ) : string Generic nonce generating function for the request.
getOAuthParams ( ) : array Gets the skeleton Oauth parameter array.
getSignature ( ) : string Call the appropriate signature method's signing function.
getSignatureMethod ( ) : string
getSigningSecret ( ) : string This is the signing secret passed to HMAC and PLAINTEXT signing mechanisms.
getTimestamp ( ) : integer
resetOAuthParams ( ) Resets the instance for subsequent signing requests.

Method Details

__construct() public method

public __construct ( array $config )
$config array OAuth config

getAuthorizeURL() public method

public getAuthorizeURL ( ) : string
return string

getSBS() public method

This is basically just all params (including the generated oauth ones) ordered by key, then concatenated with the method and URL GET&https%3A%2F%2Fapi.xero.com%2Fapi.xro%2F2.0%2FContacts&oauth_consumer etc.
public getSBS ( ) : string
return string

getToken() public method

public getToken ( )

getTokenSecret() public method

public getTokenSecret ( )

getVerifier() public method

public getVerifier ( )

setToken() public method

public setToken ( $token )

setTokenSecret() public method

Populated during 3-legged auth
public setTokenSecret ( $secret )

setVerifier() public method

public setVerifier ( $verifier )

sign() public method

It can be called multiple times (for different requests) on the same instance of the client. This method puts it in the oauth params in the Authorization header by default.
public sign ( Request $request )
$request XeroPHP\Remote\Request Request to sign