Skip to content

shanel262/seneca-twitter-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

seneca-twitter-auth - 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

About

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.

Install

npm install seneca-twitter-auth

Using 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"
      }
    }
..........

Other information

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

License

Copyright Mircea Alexandru and other contributors 2016, Licensed under MIT.

About

twitter oauth plugin for seneca-auth

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.8%
  • HTML 2.2%