Search code examples
reactjsreact-nativeoauthoauth-2.0passport.js

Is it secure to store Google or Facebook Oauth access Token in AsyncStorage for Login Authentication in React Native?


I need to implement a persistent and secure oauth2.0 login authentication with google and facebook in a react native app. In the React Navigation guide to authentication flow, it suggests to use AsyncStorage token. I read some posts that say AsyncStorage is not secure for storing data. Is AsyncStorage secure from XSS and CSRF attacks? I'm using mern stack with passport.js on this project.


Solution

  • React native says: "AsyncStorage is an unencrypted, asynchronous, persistent, key-value storage system that is global to the app." You can read this to find out more: https://reactnative.dev/docs/asyncstorage