{"id":28076688,"url":"https://github.com/jaredhanson/passport-twitter","last_synced_at":"2025-05-13T01:45:56.046Z","repository":{"id":37396550,"uuid":"2546427","full_name":"jaredhanson/passport-twitter","owner":"jaredhanson","description":"Twitter authentication strategy for Passport and Node.js.","archived":false,"fork":false,"pushed_at":"2024-11-23T03:07:16.000Z","size":139,"stargazers_count":468,"open_issues_count":33,"forks_count":130,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-13T01:45:50.772Z","etag":null,"topics":["oauth","passport","twitter"],"latest_commit_sha":null,"homepage":"https://www.passportjs.org/packages/passport-twitter/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=passport-twitter\u0026utm_content=about","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredhanson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"jaredhanson"}},"created_at":"2011-10-10T06:56:40.000Z","updated_at":"2025-02-28T03:02:28.000Z","dependencies_parsed_at":"2024-06-18T11:21:26.679Z","dependency_job_id":"6ce8d531-8ef0-459d-bb25-d2bc611c5777","html_url":"https://github.com/jaredhanson/passport-twitter","commit_stats":{"total_commits":167,"total_committers":13,"mean_commits":"12.846153846153847","dds":0.07784431137724546,"last_synced_commit":"1e1135446424b43f629115ad4e545b57791a8c45"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-twitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-twitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-twitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredhanson%2Fpassport-twitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredhanson","download_url":"https://codeload.github.com/jaredhanson/passport-twitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253856614,"owners_count":21974575,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oauth","passport","twitter"],"created_at":"2025-05-13T01:45:55.346Z","updated_at":"2025-05-13T01:45:56.038Z","avatar_url":"https://github.com/jaredhanson.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaredhanson"],"categories":["JavaScript"],"sub_categories":[],"readme":"# passport-twitter\n\n[Passport](https://www.passportjs.org/) strategy for authenticating with\n[Twitter](https://www.passportjs.org/features/twitter/) using [OAuth 1.0a](https://www.passportjs.org/features/oauth/).\n\nThis module lets you authenticate using Twitter in your Node.js applications.\nBy plugging into Passport, Twitter authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](https://github.com/senchalabs/connect#readme)-style middleware,\nincluding [Express](https://expressjs.com/).\n\n\u003cdiv align=\"center\"\u003e\n\n:brain: [Understanding OAuth 1.0](https://www.passportjs.org/concepts/oauth/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=passport-twitter\u0026utm_content=nav-concept) •\n:heart: [Sponsors](https://www.passportjs.org/sponsors/?utm_source=github\u0026utm_medium=referral\u0026utm_campaign=passport-twitter\u0026utm_content=nav-sponsors)\n\n\u003c/div\u003e\n\n\u003cdiv align=\"right\"\u003e\n  \u003csup\u003eDeveloped by \u003ca href=\"#authors\"\u003eJared Hanson\u003c/a\u003e.\u003c/sub\u003e\n\u003c/div\u003e\n\n---\n\n\u003cdiv align=\"center\"\u003e\n  \u003csup\u003eAdvertisement\u003c/sup\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://click.linksynergy.com/link?id=D*o7yui4/NM\u0026offerid=507388.922484\u0026type=2\u0026murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fthe-complete-nodejs-developer-course-2%2F\u0026u1=nzQ4K5UpDje9RRkYGfU82wFPXFWOCHAv5M0gEu5tJJH\"\u003eThe Complete Node.js Developer Course\u003c/a\u003e\u003cbr\u003eLearn Node. js by building real-world applications with Node, Express, MongoDB, Jest, and more!\n\u003c/div\u003e\n\n---\n\n## Install\n\n```bash\n$ npm install passport-twitter\n```\n\n## Usage\n\n#### Create an Application\n\nBefore using `passport-twitter`, you must register an application with Twitter.\nIf you have not already done so, a new application can be created at\n[Twitter Application Management](https://apps.twitter.com/).  Your application\nwill be issued a consumer key (API Key) and consumer secret (API Secret), which\nneed to be provided to the strategy.  You will also need to configure a callback\nURL which matches the route in your application.\n\n#### Configure Strategy\n\nThe Twitter authentication strategy authenticates users using a Twitter account\nand OAuth tokens.  The consumer key and consumer secret obtained when creating\nan application are supplied as options when creating the strategy.  The strategy\nalso requires a `verify` callback, which receives the access token and\ncorresponding secret as arguments, as well as `profile` which contains the\nauthenticated user's Twitter profile.   The `verify` callback must call `cb`\nproviding a user to complete authentication.\n\n```javascript\npassport.use(new TwitterStrategy({\n    consumerKey: TWITTER_CONSUMER_KEY,\n    consumerSecret: TWITTER_CONSUMER_SECRET,\n    callbackURL: \"http://127.0.0.1:3000/auth/twitter/callback\"\n  },\n  function(token, tokenSecret, profile, cb) {\n    User.findOrCreate({ twitterId: profile.id }, function (err, user) {\n      return cb(err, user);\n    });\n  }\n));\n```\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'twitter'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n```javascript\napp.get('/auth/twitter',\n  passport.authenticate('twitter'));\n\napp.get('/auth/twitter/callback', \n  passport.authenticate('twitter', { failureRedirect: '/login' }),\n  function(req, res) {\n    // Successful authentication, redirect home.\n    res.redirect('/');\n  });\n```\n\n## Examples\n\nDevelopers using the popular [Express](http://expressjs.com/) web framework can\nrefer to an [example](https://github.com/passport/express-4.x-twitter-example)\nas a starting point for their own web applications.\n\n## Authors\n\n- [Jared Hanson](https://www.jaredhanson.me/) { [![WWW](https://raw.githubusercontent.com/jaredhanson/jaredhanson/master/images/globe-12x12.svg)](https://www.jaredhanson.me/) [![Facebook](https://raw.githubusercontent.com/jaredhanson/jaredhanson/master/images/facebook-12x12.svg)](https://www.facebook.com/jaredhanson) [![LinkedIn](https://raw.githubusercontent.com/jaredhanson/jaredhanson/master/images/linkedin-12x12.svg)](https://www.linkedin.com/in/jaredhanson) [![Twitter](https://raw.githubusercontent.com/jaredhanson/jaredhanson/master/images/twitter-12x12.svg)](https://twitter.com/jaredhanson) [![GitHub](https://raw.githubusercontent.com/jaredhanson/jaredhanson/master/images/github-12x12.svg)](https://github.com/jaredhanson) }\n\n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2011-2023 Jared Hanson\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-twitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredhanson%2Fpassport-twitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredhanson%2Fpassport-twitter/lists"}