Start a new topic

Authenticate and get access token for Twitter in Custom Endpoint

Hi there,



Is there a way to still use the Kinvey library for social identities inside a custom endpoint? If not, is there a way to do authentication and access token management in the custom endpoint?




While it is not currently possible to use the Kinvey JavaScript library inside your business logic code, you are free to use the request module to submit calls to the REST API (http://devcenter.kinvey.com/rest/), which supports the operations you mentioned.
Hi there, thanks for the answer! I've been trying to do that actually. Do you know what's up with the oauth module? I tried using it but it won't seem to authenticate me properly. For testing, I used hardcoded values to put in the oauth customer key/secret and access token/secret, but it still wouldn't authenticate for some reason. Any ideas why?



modules.request.request({

method: 'POST',

uri: 'https://api.twitter.com/1.1/statuses/update.json',

qs: {status: encodeURIComponent(message)},

oauth: {

consumer_key: ''

, consumer_secret: ''

, token: ''

, token_secret: ''

},

}, function(err, res, body) {});
Without delving too deeply into the Twitter API, your code looks fine. Perhaps the token is invalid? in any case, you should try logging the response to receive from Twitter, which should help you debug. If that still does not help, perhaps try looking in a Twitter-related forum, since this appears to be less of a BL-specific question and more of a Twitter-related one.
Login or Signup to post a comment