Helped me through, despite not being the same problem the use the URL quote helped me solve this by changing a bit how I thought about it!

The final result became a little too big to paste here, but the handling ended up being relatively straightforward:

  useEffect(() => {
    if (result?.type === "success") {
      const { token, iv } = getParamsFromUrl(result.url)

      const session = decrypt(token, key, iv)
      console.log({ session })
    }
  }, [result])
🌐
Expo Documentation
docs.expo.dev › versions › latest › sdk › webbrowser
WebBrowser - Expo Documentation
expo-web-browser provides access to the system's web browser and supports handling redirects. On Android, it uses ChromeCustomTabs and on iOS, it uses SFSafariViewController or ASWebAuthenticationSession, depending on the method you call. As of iOS 11, SFSafariViewController no longer shares cookies with Safari, so if you are using WebBrowser for authentication you will want to use WebBrowser.openAuthSessionAsync...
🌐
Stack Overflow
stackoverflow.com › questions › 75263907 › how-to-handle-auth-with-webbrowser-openauthsessionasync-in-expo
react native - How to handle Auth with WebBrowser.openAuthSessionAsync in Expo? - Stack Overflow
import { useEffect, useState } from "react" import { Button, View, Text } from "react-native" import * as WebBrowser from "expo-web-browser" import * as Linking from "expo-linking" export default () => { const [result, setResult] = useState<WebBrowser.WebBrowserAuthSessionResult | null>(null) useEffect(() => { console.log(result) }, [result]) const _handlePressButtonAsync = async () => { const baseUrl = "https://...com" const callbackUrl = Linking.createURL("App", { scheme: "myapp" }) setResult( await WebBrowser.openAuthSessionAsync( `${baseUrl}/login?returnUrl=${encodeURIComponent( `${baseUrl}/_v/login?token=...&iv=...&returnUrl=${callbackUrl}` )}`, callbackUrl ) ) } return ( <View className="items-center justify-center flex-1"> <Button title="Open Auth Session" onPress={_handlePressButtonAsync} /> {result && <Text>{JSON.stringify(result)}</Text>} </View> ) }
🌐
Expo Documentation
docs.expo.dev › versions › latest › sdk › auth-session
AuthSession - Expo Documentation
Options passed to the promptAsync() method of AuthRequests. This can be used to configure how the web browser should look and behave.
🌐
GitHub
github.com › expo › expo › issues › 6289
WebBrowser.openAuthSessionAsync returns "dismiss" even when the user successfully logged in · Issue #6289 · expo/expo
July 27, 2019 - const redirectUrl = await Linking.makeUrl(...); var result = await WebBrowser.openAuthSessionAsync( uri + '?response_type=code' + '&client_id=' + process.env.OAUTH_CLIENT_ID + '&redirect_uri=' + encodeURIComponent(redirectUrl) + '&state=' + challenge.state + '&code_challenge=' + challenge.code_challenge + '&code_challenge_method=' + challenge.method); Right after the await, check the result type for the case where the user canceled the login. if (result.type == "dismiss") { // Browser was dismissed without logging in.
Published   Nov 15, 2019
🌐
GitHub
github.com › expo › expo › issues › 35066
expo-web-browser openAuthSessionAsync doesnt dismiss when sign in with apple page is dismissed. · Issue #35066 · expo/expo
February 20, 2025 - We are using IdentityServer4 (an identity provider) in front of our AppleAuthentication. We are using expo-web-browser to sign in the user with apple. When the sign in with apple screen is prompted and we dismiss it, we the web view should return a result dismissed.
Published   Feb 20, 2025
Find elsewhere
🌐
Reddit
reddit.com › r/expo › expo webbrowser.openauthsessionasync not opening on android
r/expo on Reddit: Expo WebBrowser.openAuthSessionAsync not opening on Android
March 21, 2024 -

I am having issue with WebBrowser.openAuthSessionAsync not opening on Android. We are using the webBrowser for user to login or create an account on the WebBrowser, but currently nothing open when I press on handlePressLoginAccount:

  const disabledDeepLinks = [
    'https://www.mydomain.com/app-login',
    'https://www.mydomain.com/app-signup'
  ];
const handlePressLoginAccount = async () => {
    const redirectUri = AuthSession.makeRedirectUri({ scheme: 'mtlblog' });
     console.log('Redirect URI:', redirectUri); 
    const loginAuthUrl = `https://www.mydomain.com/app-login?redirect_uri=${encodeURIComponent(redirectUri)}`;
    const baseLoginUrl = loginAuthUrl.split('?')[0];

      try {
        let result;

        if (Platform.OS === 'android' && disabledDeepLinks.includes(baseLoginUrl)) {
          Alert.alert('android open webbrowser ' + 
disabledDeepLinks.includes(baseLoginUrl));
          result = await WebBrowser.openAuthSessionAsync(loginAuthUrl, redirectUri);
        } else {
          result = await WebBrowser.openAuthSessionAsync(loginAuthUrl, redirectUri);
        }

        console.log('Browser opened successfully', JSON.stringify(result));

        if (result.type === 'success' || result.url) {
          const { token, userId } = extractParams(result.url);
          if (token && userId) {
            await SecureStore.setItemAsync('token', token);
            await SecureStore.setItemAsync('userId', userId);
            setAuthenticated(true);
            setSkippedLoginUser(false);
          } else {
            console.log('Login Failed', 'No authentication data found.');
          }
        } else {
          console.log('Login Failed', 'Authentication was not completed.');
        }
      } catch (error) {
        console.log('Error', 'Failed to open web browser.');
        console.error('Failed to open web browser:', error);
      }
    };

We are not sure if this issue is due to how we configure the deep link for android:

"intentFilters": [
        {
          "action": "VIEW",
          "autoVerify": true,
          "data": [
            {
              "scheme": "https",
              "host": "www.mydomain.com",
              "pathPrefix": ""
            }
          ],
          "category": [
            "DEFAULT",
            "BROWSABLE"
          ]
        }
      ]
🌐
GitHub
github.com › expo › expo › issues › 7763
WebBrowser.openAuthSessionAsync and related calls skip user input even when browser session expired · Issue #7763 · expo/expo
April 9, 2020 - The code is in a private repo so I can't share details of it, but it's a very standard oauth flow, and seeing it's happening in all three of the method calls from the top suggests to me that it may be due to something in the WebBrowser.openAuthSessionAsync implementation. I have seen on the apple developer docs that SFAuthenticationSession has been deprecated in favour of ASWebAuthenticationSession. My understanding is that this (SFAuthenticationSession) is the browser used by expo's WebBrowser and the wrappers mentioned above (AppAuth and AuthSession) for the oauth interactions.
Published   Apr 09, 2020
🌐
Snyk
snyk.io › advisor › expo-web-browser › functions › expo-web-browser.openauthsessionasync
How to use the expo-web-browser.openAuthSessionAsync function in expo-web-browser | Snyk
expo / expo / packages / expo / build / AuthSession.js View on Github · async function _openWebBrowserAsync(startUrl, returnUrl) { // $FlowIssue: Flow thinks the awaited result can be a promise let result = await openAuthSessionAsync(startUrl, returnUrl); if (result.type === 'cancel' || result.type === 'dismiss') { return { type: result.type }; } return result; } function getStartUrl(authUrl, returnUrl) {
🌐
npm
npmjs.com › package › expo-web-browser
expo-web-browser - npm
As of iOS 11, SFSafariViewController no longer shares cookies with Safari, so if you are using WebBrowser for authentication you will want to use WebBrowser.openAuthSessionAsync, and if you just want to open a webpage (such as your app privacy policy), then use WebBrowser.openBrowserAsync. ... For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release.
      » npm install expo-web-browser
    
Published   Dec 05, 2025
Version   15.0.10
Author   650 Industries, Inc.
🌐
Snyk
snyk.io › advisor › expo-web-browser › expo-web-browser code examples
Top 5 expo-web-browser Code Examples | Snyk
Marwan01 / food-converter / node_modules / expo / build / AuthSession.js View on Github · async function _openWebBrowserAsync(startUrl, returnUrl) { // $FlowIssue: Flow thinks the awaited result can be a promise let result = await openAuthSessionAsync(startUrl, returnUrl); if (result.type === 'cancel' || result.type === 'dismiss') { return { type: result.type }; } return result; } function getStartUrl(authUrl, returnUrl) {
🌐
GitHub
github.com › expo › expo › issues › 19708
Universal Links not working on redirect in WebBrowser.openAuthSessionAsync · Issue #19708 · expo/expo
October 26, 2022 - expo-env-info 1.0.5 environment info: System: OS: Windows 10 10.0.19044 Binaries: Node: 16.13.1 - C:\Program Files\nodejs\node.EXE npm: 8.1.2 - C:\Program Files\nodejs\npm.CMD npmPackages: babel-preset-expo: ~9.2.0 => 9.2.0 expo: ^46.0.9 => 46.0.16 react: 18.0.0 => 18.0.0 react-dom: 18.0.0 => 18.0.0 react-native: 0.69.5 => 0.69.5 react-native-web: ~0.18.7 => 0.18.9 Expo Workflow: managed · Due to dependencies on Universal / App Link setup and auth, I cannot create a snack, however here are the important pieces. apple-app-site-association and /.well-known/assetlinks.json are both set up and working. When pressing on the link from the notes app, our mobile app launches successfully. result = await WebBrowser.openAuthSessionAsync(authUrl, redirectUrl)
Published   Oct 26, 2022
🌐
GitHub
github.com › expo › expo › issues › 27500
[Android][expo-web-browser] Signing in via another app will not redirect back to the initial app · Issue #27500 · expo/expo
March 7, 2024 - await WebBrowser.openAuthSessionAsync( "the_auth_link", "the_redirect_to_main_app_link" ); Ideally, we would like to open the auth page in the browser of the app instead of using the AuthApp, just like it is happening on the iOS. expo-env-info 1.2.0 environment info: System: OS: macOS 13.6.4 Shell: 5.9 - /bin/zsh Binaries: Node: 20.11.1 - ~/.nvm/versions/node/v20.11.1/bin/node Yarn: 1.22.19 - /opt/homebrew/bin/yarn npm: 10.2.4 - ~/.nvm/versions/node/v20.11.1/bin/npm Managers: CocoaPods: 1.14.3 - /opt/homebrew/bin/pod SDKs: iOS SDK: Platforms: DriverKit 23.2, iOS 17.2, macOS 14.2, tvOS 17.2, vi
Published   Mar 07, 2024
🌐
GitHub
github.com › expo › expo › issues › 15276
expo-web-browser WebBrowser.openAuthSessionAsync doenot allow app switch for MFA etc on Android · Issue #15276 · expo/expo
June 14, 2021 - expo-web-browser WebBrowser.openAuthSessionAsync doenot allow app switch, as a result if user wants to enter a secure code that is received via another notification or app then upon switch the browser is dismissed.
Published   Nov 22, 2021
🌐
GitHub
github.com › expo › expo › issues › 8918
Cannot log out from WebBrowser.openAuthSessionAsync in oauth flow for iOS13 · Issue #8918 · expo/expo
June 22, 2020 - Configure app to use WebBrowser.openAuthSessionAsync to sign in and out via google oauth. Sign in with Google account. Confirm on Safari, you are also signed in on google.com · Sign out of app. From Safari, go to google.com and sign out of Google. (You can even uninstall / reinstall Expo app here) Try signing into the app again.
Published   Jun 22, 2020