by Patrick Heneise (@PatrickHeneise, about.me/PatrickHeneise)
With this plugin you perform a reverse OAuth authentication with Twitter to register users with your service.
To understand reverse authentication, read this article
- Within Xcode, copy the folder SocialAuthenticationPlugin to your plugin directory
- Copy authentication.js to your javascript directory
- Add authentication.js to your index.html
- Find the Cordova.plist file in the project navigator, expand the "Plugins" sub-tree, and add a new entry. For the key, add Authentication, and its value will be SocialAuthenticationPlugin
- Whitelist
https://api.twitter.com/
and your application server (localhost:3000 in the demo) in your ExternalHosts in Cordova.plist - Add your Twitter consumer key (https://dev.twitter.com/apps) to SocialAuthenticationPlugin.m line 45
- From the Build Phases tab, expand Link Binary With Libraries, then click on the + button
- Select Twitter.framework, Social.framework and Accounts.framework then click Add
See example/ for a working version.
For a node.js/passport.js application server, you can use this passport strategy https://github.com/drudge/passport-twitter-token and this route https://gist.github.com/f60a49a498d13c1bcf36#file_express.js.