Giter Club home page Giter Club logo

twitter-oauth-login-in-nodejs's Introduction

twitter-oauth-login-in-nodejs

๐Ÿ’ฃ Full tutorial can be found on cri.dev! ๐Ÿš€


Create an app on developer.twitter.com and get the following key and tokens:

  • TWITTER_CONSUMER_API_KEY
  • TWITTER_CONSUMER_API_SECRET

and run in your cloned local repository (to clone the repo: git clone [email protected]:christian-fei/twitter-oauth-login-in-nodejs.git):

TWITTER_CONSUMER_API_KEY=[YOUR_TWITTER_CONSUMER_KEY] TWITTER_CONSUMER_API_SECRET=[YOUR_TWITTER_CONSUMER_SECRET] npm start

or alternatively set them in a local .npmrc file like this:

twitter_consumer_api_key=xxx
twitter_consumer_api_secret_key=xxx

and then run npm start


visit http://127.0.0.1:3000/

fastify version

to run the fastify example, run npm run fastify.

connect version

to run the connect example, run npm run connect.

twitter-oauth-login-in-nodejs's People

Contributors

christian-fei avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

twitter-oauth-login-in-nodejs's Issues

Returns code 215 - Bad Authentication Data.

I'm not sure if this is just because this is a year old or so, but this no longer works. When trying to log in, it throws an unknown error. After a few edits (changing the error object to a string and passing it onto reject), the following error occurs:

(node:18604) UnhandledPromiseRejectionWarning: Error: {"statusCode":400,"data":"{\"errors\":[{\"code\":215,\"message\":\"Bad Authentication data.\"}]}"}
    at C:\...\oauth-utilities.js:37:18
    at C:\...\node_modules\oauth\lib\oauth.js:543:17
    at passBackControl (C:\...\node_modules\oauth\lib\oauth.js:397:13)
    at IncomingMessage.<anonymous> (C:\...\node_modules\oauth\lib\oauth.js:409:9)
    at IncomingMessage.emit (events.js:388:22)
    at endReadableNT (internal/streams/readable.js:1336:12)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)

I'm just starting out with the Twitter API so I have no idea what's the issue besides that. I'm using a standalone app, so it's using 1.0 instead of 2.0.

Actually not working and shows below error

(node:58058) UnhandledPromiseRejectionWarning: Error: Error getting OAuth request token
at /Users/sebamac/projects/twitter-oauth-login-in-nodejs/oauth-utilities.js:37:18
at /Users/sebamac/projects/twitter-oauth-login-in-nodejs/node_modules/oauth/lib/oauth.js:543:17
at passBackControl (/Users/sebamac/projects/twitter-oauth-login-in-nodejs/node_modules/oauth/lib/oauth.js:397:13)
at IncomingMessage. (/Users/sebamac/projects/twitter-oauth-login-in-nodejs/node_modules/oauth/lib/oauth.js:409:9)
at IncomingMessage.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
(node:58058) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Error getting OAuth request token

I am also getting this error as well. When I try to click on log in with twitter it fails to open the page and then I get an "Error getting OAuth request token" in console. Not sure why.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.