cofacts / rumors-api

GraphQL API server for clients like rumors-site and rumors-line-bot
https://api.cofacts.tw
MIT License
109 stars 26 forks source link

Add new signin methods #254

Closed nonumpa closed 3 years ago

nonumpa commented 3 years ago

Fixes #234

Should reload db schema first.

Google sign-in

Use passport-google-oauth2

To get google OAuth credential

  1. Create OAuth Client ID credential
  2. Edit Web client and add PUBLIC_URL/callback/google to Authorized redirect URIs
  3. Paste Client ID and Client secret to env

Instagram sign-in

Use passport-instagram-graph. (passport-instagram is out-of-date.)

To get Instagram OAuth credential

  1. Create Facebook login application
  2. Setup Instagram Basic Display
  3. Add PUBLIC_URL/callback/instagram to Valid OAuth Redirect URIs
  4. Paste Client ID and Client secret to env

Tester should approve invitation here.

Should submit your app for App Review when you are ready to switch it to Live Mode.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.4%) to 85.966% when pulling 1fa88cb84be640dfddd4afcae37268bbb77a5551 on new-login-methods into 0c42992c82eb25851433f3f275b663eef84defab on master.

nonumpa commented 3 years ago

Can IG users login directly using FB?

Maybe no. They always ask user to link IG and FB account together. I think if a IG user doesn't link FB, (s)he can't use Facebook login.

Facebook says that my app review will be rejected if we use it to authenticate user.

Then we should add share (article/reply) to Instagram function to pass the review :p

MrOrz commented 3 years ago

Deployed to staging. https://dev-api.cofacts.org/callback/google should work.