resource-oauth

for managing oauth providers and sessions

npm install resource-oauth
8 downloads in the last month

oauth

for managing oauth providers and sessions

API

properties

methods

properties

for managing oauth providers and sessions

  • id

    • type : any
  • credentials

    • description : credentials for an oauth endpoint

    • properties

      • requestUrl

        • description : the requested service url

        • type : string

        • required : true

      • accessUrl

        • description : the access url for said service

        • type : string

        • required : true

      • consumerKey

        • type : string

        • required : true

      • consumerSecret

        • type : string

        • required : true

      • version

        • type : string

        • required : true

      • authorize_callback

        • description : url to be sent back to on authorization

        • type : string

        • required : true

      • signatureMethod

        • type : string

        • required : true

methods

oauth.consumer(options)

creates oauth consumer

  • options

    • type : object

    • required : true

    • properties

      • requestUrl

        • description : the requested service url

        • type : string

        • required : true

      • accessUrl

        • description : the access url for said service

        • type : string

        • required : true

      • consumerKey

        • type : string

        • required : true

      • consumerSecret

        • type : string

        • required : true

      • version

        • type : string

        • required : true

      • authorize_callback

        • description : url to be sent back to on authorization

        • type : string

        • required : true

      • signatureMethod

        • type : string

        • required : true

oauth.requestToken(options, callback)

authorize by oauth

  • options

    • type : object

    • required : true

    • properties

      • requestUrl

        • description : the requested service url

        • type : string

        • required : true

      • accessUrl

        • description : the access url for said service

        • type : string

        • required : true

      • consumerKey

        • type : string

        • required : true

      • consumerSecret

        • type : string

        • required : true

      • version

        • type : string

        • required : true

      • authorize_callback

        • description : url to be sent back to on authorization

        • type : string

        • required : true

      • signatureMethod

        • type : string

        • required : true

  • callback

    • required : true

    • default : function (error, oauthToken, oauthTokenSecret, results) {

      if (error) {
        logger.error(error);
      }
      else {
        logger.info('oauth token:', oauthToken);
        logger.info('oauth token secret:', oauthTokenSecret);
      }
      

      }

oauth.accessToken(options, callback)

get oauth access token

  • options

    • required : true

    • properties

      • requestToken

        • required : true
      • requestTokenSecret

        • required : true
      • oauthVerifier

        • required : false
  • callback

    • required : true

    • default : function (error, accessToken, accessTokenSecret, results) {

      if (error) {
        logger.error(error);
      }
      else {
        logger.info('oauth access token:', accessToken);
        logger.info('oauth access token secret:', accessTokenSecret);
      }
      

      }

dependencies

README auto-generated with docs

npm loves you