README
OAUTH v1.1
DESCRIPTION
General
Installation
npm install eden-oauth
Usage
var oauth = require('eden-oauth');
Methods
getAuthorization
string getAuthorization(String);
Returns the authorization header string
Parameters
- string
Returns
string
Example
Code
oauth().getAuthorization();
Outputs
RESULTS
getHmacPlainTextSignature
string getHmacPlainTextSignature();
Returns the signature
Parameters
Returns
string
Example
Code
oauth().getHmacPlainTextSignature();
Outputs
RESULTS
getHmacSha1Signature
string getHmacSha1Signature(Array);
Returns the signature
Parameters
- array
Returns
string
Example
Code
oauth().getHmacSha1Signature();
Outputs
RESULTS
getSignature
string getSignature(Array);
Returns the signature based on what signature method was set
Parameters
- array
Returns
string
Example
Code
oauth().getSignature();
Outputs
RESULTS
jsonEncodeQuery
this jsonEncodeQuery();
When sent, sends the parameters as post fields
Parameters
Returns
this
Example
Code
oauth().jsonEncodeQuery();
Outputs
RESULTS
getResponse
array getResponse(Array);
Returns the token from the server
Parameters
- array
Returns
array
Example
Code
oauth().getResponse();
Outputs
RESULTS
setCallback
this setCallback(String);
Sets the callback for authorization This should be set if wanting an access token
Parameters
- string
Returns
this
Example
Code
oauth().setCallback();
Outputs
RESULTS
setHeaders
this setHeaders(Array|string);
Sets request headers
Parameters
- array|string
Returns
this
Example
Code
oauth().setHeaders();
Outputs
RESULTS
setMethodToGet
this setMethodToGet();
When sent, appends the parameters to the URL
Parameters
Returns
this
Example
Code
oauth().setMethodToGet();
Outputs
RESULTS
setMethodToDelete
this setMethodToDelete();
When sent, appends the parameters to the URL
Parameters
Returns
this
Example
Code
oauth().setMethodToDelete();
Outputs
RESULTS
setMethodToPost
this setMethodToPost();
When sent, sends the parameters as post fields
Parameters
Returns
this
Example
Code
oauth().setMethodToPost();
Outputs
RESULTS
setRealm
this setRealm(String);
Some Oauth servers requires a realm to be set
Parameters
- string
Returns
this
Example
Code
oauth().setRealm();
Outputs
RESULTS
setSignatureToHmacSha1
this setSignatureToHmacSha1();
Sets the signature encryption type to HMAC-SHA1
Parameters
Returns
this
Example
Code
oauth().setSignatureToHmacSha1();
Outputs
RESULTS
setSignatureToRsaSha1
this setSignatureToRsaSha1();
Sets the signature encryption to RSA-SHA1
Parameters
Returns
this
Example
Code
oauth().setSignatureToRsaSha1();
Outputs
RESULTS
setSignatureToPlainText
this setSignatureToPlainText();
Sets the signature encryption to PLAINTEXT
Parameters
Returns
this
Example
Code
oauth().setSignatureToPlainText();
Outputs
RESULTS
setToken
this setToken(String, String);
Sets the request token and secret. This should be set if wanting an access token
Parameters
string
string
Returns
this
Example
Code
oauth().setToken();
Outputs
RESULTS
setVerifier
this setVerifier(String);
Some Oauth servers requires a verifier to be set when retrieving an access token
Parameters
- string
Returns
this
Example
Code
oauth().setVerifier();
Outputs
RESULTS
useAuthorization
this useAuthorization(Bool);
When sent, appends the authroization to the headers
Parameters
- bool
Returns
this
Example
Code
oauth().useAuthorization();
Outputs
RESULTS
