A Seneca.js a seneca-auth plugin
This plugin is used by seneca-auth for authenticating via twitter login. It uses PassportJS. The seneca-auth is the authentication plugin used by Seneca toolkit.
For a gentle introduction to Seneca itself, see the senecajs.org site.
If you're using this plugin module, feel to contact on twitter if you have any questions! :) @rjrodger
- Version: 0.1.1
- License: MIT
seneca-twitter-auth's source can be read in an annotated fashion by,
- running
npm run annotate
- viewing online.
The annotated source can be found locally at ./docs/twitter-auth.html.
If you're using this module, and need help, you can:
- Post a github issue,
- Tweet to @senecajs,
- Ask on the Gitter.
If you are new to Seneca in general, please take a look at senecajs.org. We have everything from tutorials to sample apps to help get you up and running quickly.
npm install seneca-twitter-auth
When using seneca-auth the twitter auth must be initialized using:
..........
service: {
"local": {},
"twitter" : {
"apiKey" : "TWITTER_KEY",
"apiSecret" : "TWITTER_SECRET",
"urlhost" : "http://localhost:3000"
}
}
..........
There is provided a default seneca action that will prepare user data to a more convenient structure. If this data structure is not matching the expected user data structure used by your application, you can overwrite the seneca action and implement your own twitter-login-data action.
- {role: 'auth', prepare: 'twitter_login_data'}
The JSON object provided for this action contains following data from Twitter login:
- accessToken
- tokenSecret
- profile
Note: You can provide also the callbackUrl as part of the options. If not provided then a default value is used.
Default value for callbackUrl: '/auth/twitter/callback'
Register your app on twitter
The Senecajs org encourage open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.
Copyright Nicolas Herment and other contributors 2016, Licensed under MIT.