question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google auth redirect opens new instance of app

See original GitHub issue

🐛 Bug Report

Summary of Issue

Using the expo-google-app-auth authentication from a managed workflow, when running the app on android the redirect after authentication opens a second instance of the app.

Environment - output of expo diagnostics & the platform(s) you’re targeting

  Expo CLI 3.23.1 environment info:
    System:
      OS: Linux 5.4 Ubuntu 20.04.1 LTS (Focal Fossa)
      Shell: 5.8 - /usr/bin/zsh
    Binaries:
      Node: 14.6.0 - /usr/bin/node
      Yarn: 1.22.4 - /usr/bin/yarn
      npm: 6.14.6 - /usr/bin/npm
    npmPackages:
      expo: ~38.0.8 => 38.0.8 
      react: ~16.11.0 => 16.11.0 
      react-dom: ~16.11.0 => 16.11.0 
      react-native: https://github.com/expo/react-native/archive/sdk-38.0.2.tar.gz => 0.62.2 
      react-native-web: ~0.11.7 => 0.11.7 
    npmGlobalPackages:
      expo-cli: 3.23.1

Reproducible Demo

  const result = await Google.logInAsync({
    androidClientId: 'CLIENT_ID,
    iosClientId: 'CLIENT_ID,
    scopes: ['profile', 'email'], 
  })
  if (result.type !== 'success') {
    throw Error('sign in with google failed')
  }

Steps to Reproduce

  • Activate code above
  • Successfully sign in with google
  • Check application switcher and notice second version of the app is now running.

Expected Behavior vs Actual Behavior

The redirect should return to the original version of the app. Instead, a second instance is opened. This is most noticeable when authentication fails as error states are shown on the original (backgrounded) app and not the new (foregrounded) app.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
esamelsoncommented, Aug 25, 2020

Seems like this has been fixed in Android 11 beta 3, so closing this.

0reactions
esamelsoncommented, Aug 25, 2020

Hi there – could someone experiencing this issue give it a try on the latest Android 11 beta 3 release? I was not able to reproduce this issue on either an emulator or device running this version, using either expo-google-app-auth or Notifications.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Google sign with a redirect instead of a new ...
I am using a Google App Engine (Java) with Google Cloud Endpoints. I would like to use Endpoint's built in authentication, and am...
Read more >
Using OAuth 2.0 for Web Server Applications | Authorization
Using OAuth 2.0 for Web Server Applications ; Open the API Library in the Google API Console. If prompted, select a project, or...
Read more >
Authentication State Persistence | Firebase - Google
Indicates that the state will only persist in the current session or tab, and will be cleared when the tab or window in...
Read more >
Sign users in to your web app using the redirect model | Okta ...
Add authentication with Okta's redirect model (opens new window) to your server-side web app. This example uses Okta as the user store.
Read more >
Setting up OAuth 2.0 - Google Cloud Platform Console Help
To remove the unverified app screen, you can request OAuth developer verification by our team when you complete the Google API Console OAuth...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found