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.

Expo Google auth fails on standalone android app

See original GitHub issue

I am trying to implement google oauth with expo.it works perfectly on Expo but when i compile to apk. Once I click on google-login it opens a pop-up then i select my email after that it opens back my login screen again which is wrong.

  try {
    const result = await Expo.Google.logInAsync({
      androidClientId: ' ',
      iosClientId: ' ',
      androidStandaloneAppClientId: ' ',
      iosStandaloneAppClientId: ' ',
      webClientId: ' ',
      scopes: ['profile', 'email']
    });

    if (result.type === 'success') {
      this.props.navigation.navigate('Home')
    } else {
      alert('authentication failed')
    }
  } catch (e) {
   alert('authentication failed')

  }

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
maharjanamancommented, Jul 5, 2019

@codeMonk404 I think there a PR https://github.com/expo/expo/pull/4671. Hope this helps.

1reaction
samhiattcommented, Mar 3, 2018

That was my problem. I finally got Google login working on an Android standalone app. Both webClientId and androidStandaloneAppClientId seem to be required when calling Expo.Google.logInAsync within a standalone app, otherwise the idToken won’t be included in response.

Read more comments on GitHub >

github_iconTop Results From Across the Web

expo-auth-session cannot complete google login on android ...
I'm working on a react native app using expo. I've used expo-auth-session/providers/google package to sign-in.
Read more >
Google provider does not work in standalone build - Expo SDK
Has anyone got the “new” google provider in expo-auth-session to work in a standalone apk? I just get a result type of “dismiss”....
Read more >
Adding Google Auth to Expo React Native Apps for Android ...
Hi everyone!Non-deprecated approach here: https://youtu.be/hmZm_jPvWWMToday I want to show you how to add Google Auth to your Expo React ...
Read more >
React Native: How to Add Firebase Google authenticaton in ...
For Android · Add the correct package.name in app. · Build an apk from your project · Create Google certificate fingerprint with expo...
Read more >
OAuth 2.0 for Mobile & Desktop Apps - Google Developers
Web developers may encounter this error when an Android app opens a general web link in an embedded user-agent and a user navigates...
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