Hello All,
I have a problem with the Authentication methods. Firstly I used A Laravel API with Airlock to handle auth calls, the login was in RN. But the second screen with my Apptabs have WebViews loaded and I can’t share the token so the user will see again a login screen.
What I am doing now is using Laravel pasport so I can use the expo Authsession so I can do a browser based authentication. The authentication is working but how can I pass the cookies/sessions or tokens to the WebViews in the RN app? Do I need to use custom headers? what is the solution?
Below is the authsessioin that opens a browsed based auth and it returns to the app but in the app you need to login again because I need a way to pass the info
const _handlePressButtonAsync = async () => {
let redirectUrl = AuthSession.getRedirectUrl();
let result = await AuthSession.startAsync(
{
authUrl:
`https://urenstaat-laravel.test/oauth/authorize?response_type=code` +
`&client_id=3` +
`&redirect_uri=${encodeURIComponent(redirectUrl)}`,
}
);
Below is the WebView that I load
<WebView
originWhitelist={["*"]}
cacheMode="LOAD_CACHE_ELSE_NETWORK"
cacheEnabled
sharedCookiesEnabled={true}
source={{
uri: "http://urenstaat-laravel.test/registration",
}}
style={{ marginTop: -130 }}
/>
I am using Expo SDK v36.0.0 and the app is for iOS and Android
Moessie