npm.io
0.0.32 • Published 11 years ago

eden-oauth

Licence
—
Version
0.0.32
Deps
6
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

#OAUTH v1.1

DESCRIPTION

Build Status

General

Installation

npm install eden-oauth
Usage
var oauth = require('eden-oauth');

Methods


getAuthorization
 string getAuthorization(String);

Returns the authorization header string

Parameters
  1. 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
  1. array
Returns

string

Example
Code
oauth().getHmacSha1Signature();
Outputs
RESULTS

getSignature
 string getSignature(Array);

Returns the signature based on what signature method was set

Parameters
  1. 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
  1. 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
  1. string
Returns

this

Example
Code
oauth().setCallback();
Outputs
RESULTS

setHeaders
 this setHeaders(Array|string);

Sets request headers

Parameters
  1. 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
  1. 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
  1. string

  2. 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
  1. string
Returns

this

Example
Code
oauth().setVerifier();
Outputs
RESULTS

useAuthorization
 this useAuthorization(Bool);

When sent, appends the authroization to the headers

Parameters
  1. bool
Returns

this

Example
Code
oauth().useAuthorization();
Outputs
RESULTS

Keywords