Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:04:22+00:00 2026-06-09T14:04:22+00:00

I am trying to implement login with twitter using the node.js ntwitter package. https://github.com/AvianFlu/ntwitter

  • 0

I am trying to implement login with twitter using the node.js ntwitter package.

https://github.com/AvianFlu/ntwitter

I am able to make API calls correctly if I hardcode my credentials, however I am can’t seem to get the Oauth request for authentication to work.

I am using Express.js. I am just trying to get an initial ‘toy’ example to work so I have just created a separate route at this point that I am visiting directly

app.get('/twitter_login', function(req, res){
var twitter = require('ntwitter');
var twit = new twitter({
    consumer_key: '<Valid Consumer Key>',
    consumer_secret: '<Valid Consumer Secret'});
var tlog = twit.login(req,"/login_success");
tlog(res,req,null); //Not sure on this at all

Right now the error I receive is

DEBUG: TypeError: Parameter 'url' must be a string, not undefined
    at Object.urlParse [as parse] (url.js:96:11)
    at handle (/usr/local/lib/node_modules/ntwitter/lib/twitter.js:341:20)
    at <my app path>/app.js:47:3

I have a few questions

  1. The ntwitter function returns a named function called ‘handle’. Why is it named? What is the best way to call it?
  2. Why is login being done in 2 phases? Why not just a login function?
  3. Most Importantly: How do I get my users redirect to twitter so they can login?

I might be way off track here, but so feel free to suggest better methods. I would really like to stick to ntwitter though.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:04:24+00:00Added an answer on June 9, 2026 at 2:04 pm

    Figured this out.

    2 fundamental issues

    1. The call into ‘handle’ has the paramaters out of order

      Originally I had

    tlog(res,req,null);

    This should be

    tlog(res,req,null);

    2.. I was rendering a template file at the end of twitter_login, which
    was causing issues with redirect

    ======

    To answer the original questions

    The ntwitter function returns a named function called ‘handle’. Why is it named? What is the best way to call it?

    Named likely to make it easier to see in the call stack

    It can be called as such

    twit.login(path.pathname,”/twitter_callback”)(req,res)

    Why is login being done in 2 phases? Why not just a login function?

    They are tied together, but the second call allows for a more idiomatic way to pass in the necessary information.

    Most Importantly: How do I get my users redirect to twitter so they can login?

    I have created a github repo that contains a working sample application.

    https://github.com/drouillard/sample-ntwitter

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement a Login with Facebook using the Open Graph API. So
im trying to implement a login with facebook/twitter functionality in my app, i read
I'm trying to implement a login system to sign into a website using public
I'm trying to implement Twitter login for my web application. I use scribe to
I am using form-login for security and I am trying to implement an authentication
Hi i was trying to implement facebook login for my django app using django-facebook
i'm trying to implement a login method for mongodb , using python (pymongo) and
I'm trying to implement Federated Login using Google App Engine Go SDK, but the
Currently I am trying to implement a login validation system. I am using ajax
Trying to implement Ryan's JS implementation of the facebook login, via his Railscast: http://railscasts.com/episodes/360-facebook-authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.