Hi Guys,
I want to implement login (User Login) in node.js Api with Twitter so could you please guide me?
So let me explain what’s approach currently i am thinking to do
- Take username and password as a request body from client
- Call Twitter login(auth) api if any api for this
- Twitter Api should give response either user is successful loggedIn or not?
Please advice on my approach .
Thank you
1 Like
dewey
#2
Hey, that’s the wrong way of doing it. The login has to be done through OAuth. You should never have the user’s password in your possession which is the point of using OAuth.
Once you acquired the user’s access token you can use one of the Node libraries to do requests on behalf of the user: Twitter API v2 tools & libraries | Docs | Twitter Developer Platform
Read this to learn how to implement a login: Authentication overview | Docs | Twitter Developer Platform
3 Likes