Posts

Showing posts with the label oauth

Authentication with React Native and API backend

I'm trying to wrap my head around oauth with a React Native app and a separate NodeJS/Express API backend. I understand https://github.com/adamjmcgrath/react-native-simple-auth offers authentication for a React Native app and http://passportjs.org/ offers authentication for a NodeJS backend. I'm unsure how to connect these two for authentication for login and access to the API. I'd like users to login to the React Native app either by email and password or via Facebook/Twitter/Google. Once logged into the app, what do I send to the API to make sure they are authenticated and have access to a specific route? Here is an example flow to login and see the logged-in user's settings: User logs into React Native app via email/password or Facebook/Twitter/Google. User is authenticated App makes request to GET /api/settings API verifies user is authenticated and returns that user's settings or API verifies user is not authenticated and returns a 403. ...