Automatically Authenticate with Web Application from React Native webView

Viewed 620

I'm building an app using react native , in that app I want to access web application using react-native-webview. Each time requires sign in to log in to web application. For authentication im using amplify . Is it possible to connect the web application through an auto login? because for both react and react native using same amplify configure user pool id

1 Answers

Try to set localStorage webview a token

let setLocalStorage = (function(){ window.localStorage.setItem('token', '${accessToken}'); })();;

in webview use this

injectedJavaScriptBeforeContentLoaded={setLocalStorage}

Related