Skip to content

consulate/consulate-twitter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

consulate-twitter

Twitter exchange plugin for consulate.

consulate-twitter allows users to login/register with Twitter and exchange a Twitter access_token for a consulate authorization code.

Usage

Just register consulate-twitter as a plugin with your consulate server:

var consulate = require('consulate')
  , twitter = require('consulate-twitter');

var app = consulate();

app.plugin(twitter({
  consumerKey: 'MY_TWITTER_CONSUMER_KEY',
  consumerSecret: 'MY_TWITTER_CONSUMER_SECRET',
  callbackURL: 'MY_TWITTER_CALLBACK_URL'
}, function(accessToken, refreshToken, profile, done) {

  // lookup user by twitter id here. if they don't exist create them
  ...

  // Return the user for your consulate system
  done(null, myUser);
}));

Tests

$ npm test

About

Twitter exchange plugin for consulate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published