Posts

Showing posts with the label authentication

React Native + Redux basic authentication

I'm looking for a way to create a basic authentication for my react-native app. I couldn't find any good example for react-native app. To login, the app sends the email/password + clientSecret to my server If OK, the server returns accessToken + refreshToken The user is logged in, all other requests include the bearer with the accessToken. If the accessToken expires, the app requests a new one with the refreshToken automatically. The user stays logged in all the time, the states should be saved in the phone. What would be the best approach for this? Thanks. When an app communicates with a HTTP API which enforces some form of authentication, the app typically follows these steps: The app is not authenticated, so we prompt the user to log in. The user enters their credentials (username and password), and taps submit. We send these credentials to the API, and inspect the response: On success (200 - OK): We cache the authentication token/ hash, becaus...