How to do facebook authentication in React Native with nodejs as backend? - node.js

I have following problem:
I have an App with React Native and I need authentication via Facebook.
I figured out how to do it with expo and the expo-facebook but my problem is, that I also need authentication in the backend, which is done with NodeJs.
What is the right approach to do it, when the backend also needs to be secure?
I looked thru the internet for ours and didnĀ“t find any tutorial...
Thanks in advance!

Check Passportjs. It's an authentication middleware for Nodejs. Search for the relevant strategy. Should be fairly easy to implement.

Related

Is there any middleware library like PassportJS for Fastify?

I was experimenting with NestJS and Fastify as an underlying HTTP framework but soon ran into a problem when tried implementing an OAuth for Google signup. Since PassportJS has been my goto library for this purpose, I thought it would work here too. Later realized that PassportJS is only compatible with Express-based web apps.
Is there a way to make PassportJS work with Fastify or a good alternate for it?

Redirect user to angular app after login with nodejs/express

I am trying to build an application in nodejs and angular 6, where the login is done with node and after successful authentication the user is redirected to an angular application. I have looked at many resources online but only seem to find examples of either angular apps with login screens (that call nodejs API endpoints to pass user credentials), or with nodejs using express and Passport. If anyone can point me in the right direction for an example of this I would be extremely greatful.
I had created a repo similar with what you're looking for.
Here's the link to the project: ngx-express-passport-setup
You can clone it & try testing it on your environment. Setup instruction is provided.
Provided with all the instructions on ReadMe.Md for someone who wants to use Passport via local, google+, facebook and twitter Step by Step.
This project uses Angular5, NodeJS and ExpressJS
Hope this will help/guide you with your problem if ever you'll decide on using PassportJS as your Authentication as it is quite actually a popular tool for NodeJS.

Using Oauth2 Node library in React app

currently I have a React app, there I need to authenticate using OAuth2. I have the server, url's,callbacks, and clients already, now the only thing that I need is to exchange the code sent by the OAuth2 server for an access token.
I was reviewing some libraries that are made for javascript to handle these situations, for example:
Simple Oauth2
Passport
I was trying with simple-oauth2 however I see that it's made for node.js applications, and they use require to import the libraries. My question is, can I use that kind of libraries on client side using React? if so, which is the correct way to import that library inside my component? because readin their examples they are focus on express/node apps. Am not really a Javascript or node developer so I need help in this.

Do i need to setup a server to use spotifys authorization code flow?

I am using Electron to create an app for my raspberry pi to run and i want to be able to use my spotify playlists but i am having a little trouble using their api. I need to use their authorization code flow which grants you an access token after you login in. My question is, do i need to have my app running on a server (in localhost) in order to be able to make use of the spotify api ? I started playing around with Express but i am still not quite sure what i am doing or need to do.
Has anyone done this before or have any advice?
Are there any nodejs modules that help with this kind of authentication?

Any suggestions for what Node.js modules I should use for user log ins?

I am building a website with the MEAN (mongodb, express, angular, node js) stack. I want users to be able to create an account on my site as well as integrate with facebook/twitter accounts. The main two options I am considering right now are Passport and Express-jwt.
I have been able to find examples of integrating Passport into node/express, but no examples of how to handle things on the front end with angular. Is this hard to do?
My main concern about express-jwt is that I have not found examples of using that with facebook log ins while there is passport-facebook for passport. Thanks for your help.
By Far the best for authentication is Passport. See the link
https://github.com/DaftMonk/angular-passport If this could prove of worth to you. Also go through the article
http://speakingaword.blogspot.in/2013/08/authentication-in-angularjs-nodejs-and.html can also be productive. Hope this is what you were asking.

Resources