DEV Community

Cover image for Implementing Authentication with Twitter OAuth 2.0 using Typescript, Express.js and Next.js
Rafid Hamid for Reinforz

Posted on • Updated on

Implementing Authentication with Twitter OAuth 2.0 using Typescript, Express.js and Next.js

Liquid syntax error: Unknown tag 'endraw'

Top comments (6)

Collapse
 
andypiper profile image
Andy Piper

Nice post! There's also a Twitter SDK for TypeScript, and an Awesome list of cool libraries and things you're welcome to add to!

Collapse
 
reinforz_dev profile image
Reinforz AI

Thank you! We plan to write on several topics in the future, so stay tuned!

Collapse
 
prishav profile image
priya sharma

Amazing post. It is really helpful and informative. and nodejs and expressjs content are really informative. thanks for sharing this. You can also check here : Blue Prism Certification

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
thermal_insulator profile image
Meraj Hasan

Hi,
Is it possible to only use port 3000 for callback too? Otherwise I have to run two separate instances (client and server) for it to work.
Also, Twitter says localhost wont work, but here it does. Any ideas why?

Collapse
 
reinforz_dev profile image
Reinforz AI

Hello.
It is possible to use port 3000 for the callback URL in Twitter. Next.js can be used to build the API route your callback URL would point. It is not too different from this approach and you can check the official Next.js documentation to see how to use Next.js API routes:

API Routes: Introduction | Next.js

Next.js supports API Routes, which allow you to build your API without leaving your Next.js app. Learn how it works here.

favicon nextjs.org