nickredmark / staart

A starter library for node projects with user accounts.
MIT License
313 stars 39 forks source link

other strategies ? #25

Closed pantchox closed 5 years ago

pantchox commented 5 years ago

what about twitter? or how do we add custom auth providers?

thanks

nickredmark commented 5 years ago

Auth providers need a server-side component and a client side component. Twitter hadn't been requested yet, so this is what needs to be done:

On the server side: The passport.js plugin passport-twitter-token needs to be ported to ooth (similarly to ooth-google).

On the client side a "Connect to twitter" button needs to be created that performs the client-side steps of this flow then sends authentication info to the server (similarly to the login with google component).

nickredmark commented 5 years ago

I added the twitter login strategy, proof of concept here: https://staart.nmr.io To activate twitter pull the last repo version and carefully compare .env with .env.dist files of the various microservices to see the configuration changes (a few other things changed as well because the previous setup was not mac compatible).

pantchox commented 5 years ago

Thank you for that!

I tried clicking on the twitter button but nothing happens, console show a POST request with result but thats it, something maybe is missing.

nickredmark commented 5 years ago

Did you try on staart.nmr.io or on your own local app?

nickredmark commented 5 years ago

ok yes there is a problem with the client code, it works only with firefox.

nickredmark commented 5 years ago

wrong diagnosis. it's just that the popup window gets blocked. I think I can find a workaround

nickredmark commented 5 years ago

It should be solved with the newest version of staart. Thanks for the feedback.

pantchox commented 5 years ago

you welcome, will try to implment it in my app! thanks 👍